Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 685
  • Last Modified:

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?
0
darkshadow88
Asked:
darkshadow88
1 Solution
 
EDDYKTCommented:
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

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now