托盘程序用到的参数说明

Private  Type NOTIFYICONDATA
    cbSize 
As   Long
    hWnd 
As   Long
    uID 
As   Long
    uFlags 
As   Long  
    uCallbackMessage 
As   Long   ( 2 )
    hIcon 
As   Long   ( 1 )
    szTip 
As   String   *   128   ( 3
    dwState 
As   Long   ( 4 )
    dwStateMask 
As   Long   ( 4 )   
    szInfo 
As   String   *   256   ( 5
    uTimeoutAndVersion 
As   Long   ( 5 )
    szInfoTitle 
As   String   *   64   ( 5 )
    dwInfoFlags 
As   Long   ( 5 )
End
 Type

1、cbSize
Size of this structure, in bytes.//结构的大小,为字节单位。

2、hWnd 
Handle to the window that receives notification messages associated with an icon in the taskbar status area. The Shell uses hWnd and uID to identify which icon to operate on when Shell_NotifyIcon is invoked.
//接受任务栏关联的消息的窗口句柄。当Shell_NotifyIcon被调用时,操作系统根据hwnd和uid来识别是哪个图标被操作。

3、uID 
Application-defined identifier of the taskbar icon. The Shell uses hWnd and uID to identify which icon to operate on when Shell_NotifyIcon is invoked. You can have multiple icons associated with a single hWnd by assigning each a different uID.
//任务栏中被定义的程序图标id,当Shell_NotifyIcon被调用时,系统根据hwnd和uid来识别哪个图标被操作。可以为单个hwnd指定不同uid的多个图标。

4、uFlags
Flags that indicate which of the other members contain valid data. This member can be a combination of the following.
//标志其他成员包含的正确数据。为联合体。

(1)NIF_ICON
The hIcon member is valid.//hIcon成员有效。

(2)NIF_MESSAGE
The uCallbackMessage member is valid.//uCallbackMessage成员有效。

(3)NIF_TIP 
The szTip member is valid.//szTip有效。

(4)NIF_STATE
The dwState and dwStateMask members are valid.//dwState and dwStateMask成员有效。

(5)NIF_INFO
Use a balloon ToolTip instead of a standard ToolTip. The szInfo, uTimeout, szInfoTitle, and dwInfoFlags members are valid.
//使用气泡工具提示代替标准提示,szInfo,uTimeout,szInfoTitle,和dwInfoFlags为有效。

(6)NIF_GUID
Reserved.//保留字段。

5、uCallbackMessage
Application-defined message identifier. The system uses this identifier to send notifications to the window identified in hWnd. These notifications are sent when a mouse event occurs in the bounding rectangle of the icon, or when the icon is selected or activated with the keyboard. The wParam parameter of the message contains the identifier of the taskbar icon in which the event occurred. The lParam parameter holds the mouse or keyboard message associated with the event. For example, when the pointer moves over a taskbar icon, lParam is set to WM_MOUSEMOVE. See the Taskbar guide chapter for further discussion.
//程序定义的消息标识符。系统利用这个标识符来发送消息给窗口。当鼠标事件在图标范围内发生,或当图标被选中或被键盘激活,则消息将发送。消息的wparam参数包含任务栏图标的标识。消息的lparam参数保存事件的鼠标或键盘消息。例如:当在任务栏图标上移动鼠标指针,则lparam参数被设置wm_mousermove。参见任务栏管理章节获得更多的描述。

6、hIcon 
Handle to the icon to be added, modified, or deleted. To avoid icon distortion, be aware that notification area icons have different levels of support under different versions of Microsoft Windows. Windows 95, Windows 98, and Microsoft Windows NT 4.0 support icons of up to 4 bits per pixel (BPP). Windows Millennium Edition (Windows Me) and Windows 2000 support icons of a color depth up to the current display mode. Windows XP supports icons of up to 32 BPP.
//被添加、修改或者删除的图标句柄。
//为避免图标变形,通知区域的图标必须有不同ms版本的支持水平。win95,98,nt4.0支持4BPP的图标,winme和2000支持.....
//winxp支持32BPP的图标

7、szTip
Pointer to a null-terminated string with the text for a standard ToolTip. It can have a maximum of 64 characters including the terminating NULL.
//以null结尾的字符串指针。可以包含64个字符,以null结尾。
For Version 5.0 and later, szTip can have a maximum of 128 characters, including the terminating NULL.
//5.0版本以后,可以有128个字符,以null结尾

8、dwState 
Version 5.0. State of the icon. There are two flags that can be set independently.//图标状态,有2个标记,可以单独设置。

NIS_HIDDEN
The icon is hidden.//图标隐藏

NIS_SHAREDICON
The icon is shared.//图标共享

9、dwStateMask
Version 5.0. A value that specifies which bits of the state member are retrieved or modified. For example, setting this member to NIS_HIDDEN causes only the item's hidden state to be retrieved.
//5.0版本。说明哪几位状态成员被找回或修改。例如:成员设置为NIS_HIDDEN,隐藏的项目会被找回。-------可能这里有错。

10、szInfo
Version 5.0. Pointer to a null-terminated string with the text for a balloon ToolTip. It can have a maximum of 255 characters. To remove the ToolTip, set the NIF_INFO flag in uFlags and set szInfo to an empty string.
//5.0版本,气泡提示以null结尾的字符串指针。最大为255个字符。要删除提示,在uFlags中设置NIF_INFO标志并设置seInfo为空字符串。

11、uTimeout
Union with uVersion. The timeout value, in milliseconds, for a balloon ToolTip. The system enforces minimum and maximum timeout values. uTimeout values that are too large are set to the maximum value and values that are too small default to the minimum value. The system minimum and maximum timeout values are currently set at 10 seconds and 30 seconds, respectively. See the remarks for further discussion of uTimeout.
//和uversion连用。气泡提示持续时间,毫秒单位,系统执行最小和最大的持续值。

12、uVersion
Version 5.0. Union with uTimeout. Specifies whether the Shell notify icon interface should use Windows 95 or Windows 2000 behavior. For more information on the differences in these two behaviors, see Shell_NotifyIcon. This member is only employed when using Shell_NotifyIcon to send a NIM_SETVERSION message.
//和utimeout连用。
//当使用Shell_NotifyIcon来发送一个NIM_SETVERSION消息时,该成员被使用。

13、szInfoTitle
Version 5.0. Pointer to a null-terminated string containing a title for a balloon ToolTip. This title appears in boldface above the text. It can have a maximum of 63 characters.
//5.0版本,气泡图标以null结尾的字符串标题。这个标题在文本上面出现。最大为63个字符。

14、dwInfoFlags
Version 5.0. Flags that can be set to add an icon to a balloon ToolTip. It is placed to the left of the title. If the szInfoTitle member is zero-length, the icon is not shown.
//5.0版本。可以添加图标在气泡提示中。放在标题的左边。若szInfoTitle为0,则图标不显示。

NIIF_ERROR
An error icon.//错误图标

NIIF_INFO
An information icon.//消息图标

NIIF_NONE
No icon. //没图标

NIIF_USER
Windows XP Service Pack 2 (SP2) and later. Use the icon identified in hIcon as the notification balloon's title icon.
//winxpSP2以上版本。使用这个标识图标做为气泡标题图标。

NIIF_WARNING
A warning icon. //警告图标。

NIIF_ICON_MASK
Version 6.0. Reserved.//6.0版本。保留

NIIF_NOSOUND
Version 6.0. Do not play the associated sound. Applies only to balloon ToolTips.
//6.0版本。没有关联的声音。仅用于气泡图标。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值