前段時間做一個 WinCe的小程序,用來檢測ZigBee網絡信號。有顯示系統托盤(NotifyIcon)的需求、
開始了。
首頁准備一個托盤的類 NotifyIcon.cs
uID =
messageWindow = MyMessageWindow( messageWindow.uID =
_Icon =
~
NotifyMessage(messageWindow.Hwnd, NIM_ADD, (
Add( IntPtr hIcon = LoadIcon(GetModuleHandle( NotifyMessage(messageWindow.Hwnd, NIM_ADD, (
NotifyMessage(messageWindow.Hwnd, NIM_ADD, (
(_Icon != NotifyMessage(messageWindow.Hwnd, NIM_ADD, (
NotifyMessage(messageWindow.Hwnd, NIM_DELETE, (
NotifyMessage(messageWindow.Hwnd, NIM_MODIFY, (
NotifyMessage(IntPtr hwnd, dwMessage, NOTIFYICONDATA notdata =
notdata.cbSize = notdata.hIcon = notdata.hWnd = notdata.uCallbackMessage = notdata.uFlags = NIF_MESSAGE | notdata.uID =
ret = Shell_NotifyIcon(dwMessage,
API
NIF_MESSAGE = NIF_ICON = WM_LBUTTONDOWN =
NIM_ADD = NIM_MODIFY = NIM_DELETE =
WM_NOTIFY_TRAY = +
[DllImport( dwMessage,
[DllImport(
[DllImport(
[DllImport(
[DllImport( IntPtr LoadIcon(IntPtr hInst,
[DllImport(
MessageWindow
_uID =
notifyIcon =
_uID =
WndProc(
(msg.Msg == (()msg.LParam == (()msg.WParam ==
(notifyIcon.Click != notifyIcon.Click(notifyIcon,
}
接下來就是 使用這個托盤類了。
SortedList table =
strRes;
netCount = caseValue = ;
notifyicon_Click(
caseValue = notifyicon = notifyicon.Click += Assembly asm = icon = Icon(asm.GetManifestResourceStream( notifyicon.Icon = }
好了,就這些,代碼有些沒用的變量自己去掉即可。