• Welcome to Valhalla Legends Archive.
 

Menubar

Started by Blade_360, January 18, 2003, 10:00 AM

Previous topic - Next topic

Blade_360

How do you add a menu to a system tray icon (i.e. when you right click it how do you add your own custom menubar?)

Skywing

#1
When you call Shell_NotifyIcon, you can specify a "callback message" and an HWND for it to be sent to.  Here's where this comes in handy... the shell sends you the "callback message" when a user right-clicks your tray icon, double clicks it, and so on.  You should test the lParam value when you receive this message for WM_RBUTTONDOWN to determine if you should display a pop-up menu.  If you receive this message, call SetForegroundWindow(hwnd_passed_to_wndproc) and then use TrackPopupMenu to display your menu.

You can check for WM_LBUTTONDBLCLK if you want to perform an action when the user double-clicks your tray icon.

Blade_360

#2
Thanks I can't belive I didn't think of that on my own
 >:( (Punches self)

JaMi

#3
lol i can! everything skywing responds to takes reading atleast 3 times before its understood to me :p

Zakath

#4
That's because you aren't familiar with how Windows actually deals with user interaction.
Quote from: iago on February 02, 2005, 03:07 PM
Yes, you can't have everybody...contributing to the main source repository.  That would be stupid and create chaos.

Opensource projects...would be dumb.

JaMi

#5
this is correct, im not complaining though, Just stating that he actually makes me think, which in turn helps me learn :p