How can I create a tray icon
2008-04-09 04:21:54来源:互联网 阅读 ()
* How can I create a tray icon? *
Fortunately, creating an application that runs in the system tray is pretty easy -
only one (API) function, Shell_NotifyIcon, is needed to accomplish the task.
The function is defined in the ShellAPI unit and requires two parameters.
The first parameter (dwMessage) specifies the action to be taken.
This parameter can be one of the following 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.
* To display an icon in the system tray, call Shell_NotifyIcon with
the NIM_ADD flag.
* Any time you want to change the icon, tooltip text,
etc, you can call Shell_NotifyIcon with NIM_MODIFY.
* Before your program terminates, call Shell_NotifyIcon with NIM_DELETE
to clear your icon from the system tray.
The second parameter (pnid) is a pointer to a TNotifyIconData structure
holding the information about the icon.
The TNotifyIconData structure contains the following elements:
cbSize: Passes the size of the NOTIFYICONDATA data type.
Data Type: DWORD.
hWnd: Handle of the window used to receive the notification message.
Data Type: HWND.
uId: Identifier of the icon in the status area.
Data Type: UINT.
uFlags: Array of flags that indicate which of the other members contain
valid data.
Data Type: UINT.
Value: Any combination of the following constants to indicate that
the member of this structure is valid and will be used:
NIF_ICON: Passing this flag indicates that the value for the
hIcon will be the icon that appears in the taskbar status area.
NIF_MESSAGE: Passing this flag indicates that the uCallBackMessage
value will be used as the callback message.
NIF_TIP: Passing this flag indicates that the value of szTip will
be used as the ToolTip for the icon in the taskbar status area.
uCallBackMessage: Identifier of the notification message sent to the
window that is used to receive the messages.
Data Type: UINT.
hIcon: Handle of the icon that is displayed in the taskbar status area.
Data Type: HICON.
szTip: String to be used as the ToolTip text.
Data Type: Fixed-length AnsiChar 64 bytes long.
*****************************************************}
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有
下一篇:Delphi 函数参考
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash