Private Sub Form_Resize()
On Error GoTo ErrorHandle
txtTerm.Move 0, 0, ScaleWidth, ScaleHeight
Dim nd As NOTIFYICONDATA
With nd
.cbSize = Len(nd)
.hIcon = Icon.Handle
.hWnd = hWnd
.szTip = App.Title & vbNullChar
.uCallbackMessage = &H200
.uFlags = NIF_MESSAGE Or NIF_ICON Or NIF_TIP
.uID = &H1000
End With
If WindowState <> vbMinimized Then
lOperator = conlngOperatorMax
Tag = WindowState
Shell_NotifyIcon NIM_DELETE, nd
Else
If Shell_NotifyIcon(NIM_ADD, nd) Then Hide
End If
Exit Sub
ErrorHandle:
ShowErr
Resume Next
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
On Error GoTo ErrorHandle
Static xa(3) As Long
xa(0) = xa(1)
xa(1) = xa(2)
xa(2) = xa(3)
xa(3) = X
If X = 7710 Then
If xa(2) = 7725 Then
If xa(1) = 7710 Then
If xa(0) = 7695 Then
ShellIconDblClick
End If
End If
End If
ElseIf X = 7755 Then
If xa(2) = 7740 Then
ShellIconMouseUpRight
End If
End If
Exit Sub
ErrorHandle:
ShowMsg "MouseMove: " & Err.Description, True
End Sub