# Re: 请问在VB中，如何使程式缩小至系统时间的小ICON...

Posted by South Wind on October 15, 1999 at 11:58:21:

In Reply to: 请问在VB中，如何使程式缩小至系统时间的小ICON... posted by 长空 on October 15, 1999 at 11:15:21:

: 各位高手，请问一下如何将自已设计的程式，在执行中，缩小至时间
: 工作列的小图示。是否有何属性或是工具等等方法吗？？

要用到API - Shell_NotifyIcon

Public Declare Function Shell_NotifyIcon Lib "shell32.dll" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, lpData As NOTIFYICONDATA) As Long
Public Const NIF_ICON = &H2 '指定Icon
Public Const NIF_MESSAGE = &H1 '接收Message
Public Const NIF_TIP = &H4 '显示Tip
Public Const NIM_ADD = &H0 '新增Icon
Public Const NIM_DELETE = &H2 '删除Icon
Public Const NIM_MODIFY = &H1 '变更Icon

Public Type NOTIFYICONDATA
cbSize As Long
hwnd As Long
uID As Long
uFlags As Long
uCallBackMessage As Long
hIcon As Long
szTip As String * 64
End Type

Dim nid As NOTIFYICONDATA

nid.cbSize = Len(nid)
nid.hwnd = Me.hwnd
nid.uID = 9999
nid.uFlags = NIF_ICON + NIF_TIP + NIF_MESSAGE
nid.hIcon = Me.Icon
nid.szTip = "ABCDE" & Chr(0)
nid.uCallBackMessage = WM_USER + 100
Shell_NotifyIcon NIM_ADD, nid

更详细的说明可以找王国荣的Windows API讲座一书
有详细范例

- D.J. Studio - VB小馆

Follow Ups: