在程序中使用 Windows的Task Bar (转)

在程序中使用 Windows的Task Bar (转)[@more@]在 程序中使用 windows的Task Bar。 Windows的Task Bar是一标准 控件。 使用到的结构是NOTIFYICONDATA: typedef struct _NOTIFYICONDATA { D word cbSize; HWND hWnd; UINT uID; UINT uFlags; UINT uCallbackMessage; HICON hIcon; char szTip[64]; } NOTIFYICONDATA, *PNOTIFYICONDATA; Contains information that the system needs to process taskbar status area messages. cbSize :Size of this structure, in bytes. hWnd : Handle to the window that will receive notification messages associated with an icon in the taskbar status area. uID :Application-defined identifier of the taskbar icon. uFlags: Array of flags that indicate which of the other members contain valid data. This member can be a combination of the following: NIF_ICON The hIcon member is valid. NIF_MESSAGE The uCallbackMessage member is valid. NIF_T ip The szTip member is valid. uCallbackMessage : Application-defined message identifier. The system uses this identifier for notification messages that it sends to the window identified in hWnd. These notifications are sent when a mouse event occurs in the bounding rectangle of the icon. hIcon :Handle to the icon to add, modify, or delete. szTip : Tooltip text to display for the icon. 使用的通信 函数shell_NotifyIcon: WINSHELL api BOOL WINAPI Shell_NotifyIcon( DWORD dwMessage, PNOTIFYICONDATA pnid); Sends a message to the system to add, modify, or delete an icon from the taskbar status area. Returns nonzero if succes sful, or zero otherwise. dwMessage : Message value to send. This parameter can be one of these values: 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 : Address of a NOTIFYICONDATA structure. The content of the structure depends on the value of dwMessage. 通过上面的结构和函数可以很容易把我们的程序做得更加professional.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10752043/viewspace-990728/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/10752043/viewspace-990728/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值