谁有用SDk做系统托盘的例子,贴出来一下,或给个链接。谢谢!!
解决方案 »
- spy++的问题
- ¢ ¢怎样才能把尸体弄走?
- 如何在程序中设置打印机的设置??
- 怎样将CString或char型转换为Date型
- 如何替换windows98的登陆框为自己的程序?
- 如何获得某段代码在执行时内存消耗的峰值?请指教!
- ******祝愿csdn更上一层楼,大家国庆快乐******
- (急)请教如何在vs2008中给下拉菜单添加响应事件
- 为什么Debug版有内存泄漏Release版却没有?
- MFC 一个对话框类 怎么没有WM_GETMINMAXINFO消息 而与之同源的cframewnd却有这个消息
- SOS:没法自动登陆Discuz! 2.5 !!!!!!
- 如何实现象Visual Assist在Visual Studio6代码窗口上方的那种界面?
// Returns TRUE if successful, or FALSE otherwise.
// hwnd - handle to the window to receive callback messages.
// uID - identifier of the icon.
// hicon - handle to the icon to add.
// lpszTip - ToolTip text. BOOL MyTaskBarAddIcon(HWND hwnd, UINT uID, HICON hicon, LPSTR lpszTip)
{
BOOL res;
NOTIFYICONDATA tnid;
tnid.cbSize = sizeof(NOTIFYICONDATA);
tnid.hWnd = hwnd;
tnid.uID = uID;
tnid.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP;
tnid.uCallbackMessage = MYWM_NOTIFYICON;
tnid.hIcon = hicon;
if (lpszTip)
hr = StringCbCopyN(tnid.szTip, sizeof(tnid.szTip), lpszTip,
sizeof(tnid.szTip));
// TODO: Add error handling for the HRESULT.
else
tnid.szTip[0] = (TCHAR)'\0';
res = Shell_NotifyIcon(NIM_ADD, &tnid);
if (hicon)
DestroyIcon(hicon);
return res;
}// MyTaskBarDeleteIcon - deletes an icon from the taskbar status area.
// Returns TRUE if successful, or FALSE otherwise.
// hwnd - handle to the window that added the icon.
// uID - identifier of the icon to delete. BOOL MyTaskBarDeleteIcon(HWND hwnd, UINT uID)
{
BOOL res;
NOTIFYICONDATA tnid;
tnid.cbSize = sizeof(NOTIFYICONDATA);
tnid.hWnd = hwnd;
tnid.uID = uID;
res = Shell_NotifyIcon(NIM_DELETE, &tnid);
return res;
}