Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Menu in System Tray
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Menu in System Tray

 Post Reply Post Reply
Author
Message
Majek View Drop Down
Groupie
Groupie


Joined: 20 November 2006
Status: Offline
Points: 24
Post Options Post Options   Thanks (0) Thanks(0)   Quote Majek Quote  Post ReplyReply Direct Link To This Post Topic: Menu in System Tray
    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.
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 14 May 2007 at 2:27pm
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

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.043 seconds.