VB6: Dismiss system tray icon right-click menu

I made a program that has a right-click menu on a system tray icon.  The problem is, after right-clicking, the only way to dismiss the menu is to select an option or click on the icon again.  How can I make the right-click menu go away when the user clicks outside the menu?
darkshadow88Asked:
Who is Participating?
 
EDDYKTConnect With a Mentor Commented:
Call SetForegroundWindow before you call popupmenu

ie

private Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long


SetForegroundWindow Me.hwnd
PopupMenu mnuStat, , , , Yourmenu
0
All Courses

From novice to tech pro — start learning today.