If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Because of some bug in the Explorer shell the menu isn't dismissed when someone clicks outside of it, so I had to add the following code to accommodate for that (which can be found throughout Win32 forums online):

That takes away that bug, but what happens is that at times when my tray icon is first displayed on the task bar's tray and I try to right-click it, I get my pop-up menu and also get the default task bar menu (picture below) displayed over it, as if I right-clicked the task bar itself. This happens only the first time I right-click my tray icon.

Re: TrackPopupMenu and default taskbar menu

Thanks, but I still get the same bug of two overlapping menus. I played a little with it, and to reproduce this bug you can add Sleep(500); after SetForegroundWindow call to make it come up for sure. I also believe that this only happens when some other window has keyboard focus (like any other Explorer window.)

Re: TrackPopupMenu and default taskbar menu

Can someone tell me why this happens and how to remedy that?

It seems the effect has nothing to do with your code. I had the effect of the kind in regular Explorer window while right clicking an element without selecting it previously. So it's rather Win7 Explorer behavior.

* The Perfect Platform for Game Developers: Android
Developing rich, high performance Android games from the ground up is a daunting task. Intel has provided Android developers with a number of tools that can be leveraged by Android game developers.

* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.