Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: Blade_360 on January 18, 2003, 10:00 AM

Title: Menubar
Post by: Blade_360 on January 18, 2003, 10:00 AM
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?)
Title: Re: Menubar
Post by: Skywing on January 18, 2003, 10:14 AM
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.
Title: Re: Menubar
Post by: Blade_360 on January 19, 2003, 08:04 PM
Thanks I can't belive I didn't think of that on my own
 >:( (Punches self)
Title: Re: Menubar
Post by: JaMi on January 20, 2003, 02:58 AM
lol i can! everything skywing responds to takes reading atleast 3 times before its understood to me :p
Title: Re: Menubar
Post by: Zakath on January 20, 2003, 06:16 AM
That's because you aren't familiar with how Windows actually deals with user interaction.
Title: Re: Menubar
Post by: JaMi on January 20, 2003, 10:17 AM
this is correct, im not complaining though, Just stating that he actually makes me think, which in turn helps me learn :p