Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to hide a popup menu?

Status
Not open for further replies.

therick

Programmer
Mar 20, 2001
34
US
I am using TrackPopupMenu() to pull up my menu which works great. The only problem is if the user doesn't select a menuitem and wants to hide the menu, he can't. One can L or R click somewhere else and the darn menu hangs around.

How do I send a message to my app to hide the menu? I am building an app where size is the key factor in design so I'm just using stardard libraries...no MFC stuff. I am pretty sure MFC handles this somehow but I don't have the luxury of using that.

Any expertise with systray icon popupmenus would be greatly appreciated.
 
Hi!

Well, I dont know what Class you use for the Menu, but it either has a DestroyWindow() Memberfunction or you have a handle to this Window.

If you need a Version with the Handle, try the Windows Function DestroyWindow(handle) or SendMessage(handle, WM_CLOSE, NULL, NULL).

Greetings
Remo
 
Fleck~,

I am aware of these functions and would love to use either of them. My appologies...I wasn't specific enough. My real question I guess is how can I send a message to my menu that my mouse is no longer on the popup so it should close the Menu by the hMenu handle? In other words, I have tried to add code to the switch in WM_COMMAND, WM_NOTFIYICON (icon specific message sent to wndProc), etc but can't seem to get there.

Thanks for the reply and any further assistance you can provide.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top