Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

VB6: Dismiss system tray icon right-click menu

Posted on 2004-05-02
1
Medium Priority
?
684 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 26

Accepted Solution

by:
EDDYKT earned 300 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
Suggested Courses

715 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