参考相关MSDN资料Shell_NotifyIcon This function sends a message to the system to add, modify, or delete an icon from the taskbar status area.WINSHELLAPI BOOL WINAPI Shell_NotifyIcon( DWORD dwMessage, PNOTIFYICONDATA pnid ); Parameters dwMessage [in] Specifies the message value to send. It is one of these values: Value Description NIM_ADD Adds an icon to the status area. NIM_DELETE Deletes an icon from the status area. NIM_MODIFY Modifies an icon in the status area. pnid [in] Pointer to a NOTIFYICONDATA structure. The content of the structure depends on the value of dwMessage. Return Values Nonzero indicates success. Zero indicates failure. 然后自己做上一遍,就全都记住了
可能我没说清楚,我的意思是我不要那个窗口,即不要 int nResponse=dlg.DoModal();这一行,因为平时运行不需要这个对话框啊,只需要在systray里显示一个图标就可以了,不知道这样能不能实现。
对话框可以showWindow(SW_HIDE)嘛!
只向Systray那儿加个图标。处理它的菜单。留下邮箱,我给你发一个例子程序得了
或者直接跟[email protected]要。注明事项。
This function sends a message to the system to add, modify, or delete an icon from the taskbar status area.WINSHELLAPI BOOL WINAPI Shell_NotifyIcon(
DWORD dwMessage,
PNOTIFYICONDATA pnid );
Parameters
dwMessage
[in] Specifies the message value to send. It is one of these values:
Value Description
NIM_ADD Adds an icon to the status area.
NIM_DELETE Deletes an icon from the status area.
NIM_MODIFY Modifies an icon in the status area. pnid
[in] Pointer to a NOTIFYICONDATA structure. The content of the structure depends on the value of dwMessage.
Return Values
Nonzero indicates success. Zero indicates failure.
然后自己做上一遍,就全都记住了