![]() |
Menu in System Tray |
Post Reply ![]() |
Author | |
Majek ![]() Groupie ![]() Joined: 20 November 2006 Status: Offline Points: 24 |
![]() ![]() ![]() ![]() ![]() Posted: 08 May 2007 at 9:40am |
Hi, I'm using CommandBars to display a popup menu in the system tray when the user right-clicks a NotifyIcon. Everything works great except when the menu is open, and you click somewhere on the screen the menu doesn't go away when it loses focus. Is there an event that is raised when the popup menu loses focus? I want to hide the popup menu when the user clicks somewhere on the screen so it acts as a normal tray menu. I'm using VB 2005 and CommandBars 10.1.
|
|
![]() |
|
jpbro ![]() Senior Member ![]() ![]() Joined: 12 January 2007 Status: Offline Points: 1355 |
![]() ![]() ![]() ![]() ![]() |
Hi Majek,
I ran into this problem on my SysTray project that wasn't using CodeJock controls, so I believe it is a VB problem. My solution is to call the SetForegroundWindow API immediately before showing the popup menu: In your declarations: Private Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long Then in your sub: SetForegroundWindow Me.hwnd PopupMenu Me.mnuPopup |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |