Quote:
> My tasktray popup menu will not go away when i click elsewhere on the
> screen or taskbar, given that i decided not to click one of the menu
> items (the app represented by the tasktray icon is not visible at this
> stage). All other tasktray icon menus disappear when clicking
> elsewhere... how can i get my popup menu to follow this principle (i'm
> using form1.PopUpMenu menutitle... )
So far so good, look at this:
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, x As Single,
y As Single)
On Error Resume Next
Const WM_NULL = &H0
Dim r As Long
r = x / Screen.TwipsPerPixelX
If r = 513 Then 'Klick &H203 Then 'Doppelklick auf TrayIcon
If Me.Visible Then
Me.WindowState = vbMinimized
Else
WinPowerOffVordergrund True, False
End If
End If
'If r <> 512 Then Debug.Print r
If r = &H205 Then
Me.TimerMain.Enabled = False
apiSetForegroundWindow Me.hwnd
PopupMenu mnuSymbol
If Not ProgrammBeenden Then 'If not Exit
PostMessage Me.hwnd, WM_NULL, 0, 0 '<----- close PopUp
Me.TimerMain.Enabled = True
End If
End If
End Sub