VB,托盘图标,事件(窗口进入托盘图标后,点击图标打开窗口,这个事件怎么写?)

来源:百度知道 编辑:UC知道 时间:2024/06/07 21:06:46
窗口最小化后,不知道怎么写:..点击托盘图标
这个事件代码该怎么写呢?"点击托盘图标后,打开窗口!"
如何实现双击托盘图标,打开窗口??

Private Sub Form_Load()
With nfIconData
.hWnd = Me.hWnd
.uID = Me.Icon
.uFlags = NIF_ICON Or NIF_MESSAGE Or NIF_TIP
.uCallbackMessage = WM_MOUSEMOVE
.hIcon = Me.Icon.Handle
.szTip = App.Title + "(版本 " & App.Major & "." & App.Minor & "." & App.Revision & ")" & vbNullChar
.cbSize = Len(nfIconData)
End With
Call Shell_NotifyIcon(NIM_ADD, nfIconData)
End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Call Shell_NotifyIcon(NIM_DELETE, nfIconData)
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Static Message As Long
Static RR As Boolean
Message = X / Screen.TwipsPerPixelX
If RR = False Then
RR = True
Select Case Message
Case WM_LBUTTONUP
Me.Show
Me.WindowState = 0