Solved

VB6: Dismiss system tray icon right-click menu

Posted on 2004-05-02
1
676 Views
Last Modified: 2008-02-26
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
Comment
Question by:darkshadow88
1 Comment
 
LVL 26

Accepted Solution

by:
EDDYKT earned 75 total points
ID: 10972510
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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question