Hello all,
I am trying to minimize a program to the Systray. I have the code, it
works if I create a new project and insert the code. But when I add it
to an existing program the trouble starts.
It will minimize to the tray fine, but I cannot recall it. I have a
STOP statement in the MOUSEMOVE segment, but it doesn't trip when the
program ICON is displayed in the tray. I have to stop the program to
get out.
Why would it hide the form and display the ICON on the tray, but not
accept any input beyond that?
Here is some of the code I am using...
---------------------------------------------------------------------
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
Public nid As NOTIFYICONDATA
in the FORM_LOAD...
nid.cbSize = Len(nid)
nid.hwnd = Main.hwnd
nid.uId = 0
nid.uId = nid.uId + 1
nid.uFlags = &H1 Or &H2 Or &H4
nid.uCallBackMessage = &H200
nid.hIcon = Main.Icon
nid.szTip = "Salary Viewer" & Chr(0)
Private Sub Form_Resize()
If WindowState = 1 Then
Main.Hide
Main.Refresh
Shell_NotifyIcon &H0, nid
Else
Shell_NotifyIcon &H2, nid
End If
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, x As
Single, Y As Single)
Dim Sys As Long
DoEvents
stop
Sys = x / Screen.TwipsPerPixelX
Select Case Sys
Case &H204
PopupMenu mnusystray
End Select
End Sub
---------------------------------------------------------------------
Thanks in advance,
---------------------------------------------------
Brian Howe
Information is power. Thanks to all who empower me
---------------------------------------------------