views:

188

answers:

1

We are experiencing this annoying problem where we have a context menu on our tray icon, if we display this context menu we have to SetForegroundWindow and bring it to the front. This is really annoying and not at all what we want.

Is there a workaround, I notice that Outlook MS Messenger and other MS apps do not suffer this, perhaps they are not using a standard menu and have had to write their own ... why dont they release this code if they have?

This article describes the 'as design' behaviour: Menus for Notification Icons Do Not Work Correctly

EDIT We are using C++/Win32 not forms, so we use TrackPopupMenu.

+2  A: 

Are you using ContextMenu or ContextMenuStrip?

Your saying that opening the ContextMenu on a trayicon focuses all app forms?

I have not experienced that, though I use the newer ContextMenuStrip class, not ContextMenu for my trayicons.

EDIT: Would be nice to know if you are using Windows.Forms or WIN32, or MFC or what.

FlySwat