I'm trying to create context menu in my application using the TrackPopupMenu function, I use that code Is:
Seamen menu; If (menu.LoadMenu (IDR_MENU_TRAY)) {CMenu * pSubMenu = menu.GetSubMenu (0); If (pSubMenu! = NULL) {pSubMenu-> ModifyMenu (IDM_CLOSE, MF_BYCOMMAND, IDM_CLOSE, g_cfg- & gt; GetLang (TEXT_MAIN_CLOSE, "Exit (& X)")); PSubMenu-> ModifyMenu (IDM_SHOW, MF_BYCOMMAND, IDM_SHOW, g_cfg- & gt; GetLang (TEXT_MAIN_OPEN_SHUTTER, "Open (and O)")); Indication mark; GetCursorPos (& amp; Point); SetForegroundWindow (); PSubMenu-> TrackPopupMenu (TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y, messageOnline); }} The code runs full on WinXP, while on win7 and Vista it is not. The problem on Win7 and Vista is that the menu takes a lot of time to pop up, maybe 1 minute or more. But if I turn off Aero on Winter 7 or Vista, then it simply runs on winXP, so I think the code should be contradictory about something with Amy, but I do not know if this How to fix Can anyone help me in that?
I do not see anything wrong with it. I used the TrackPopupMenu on Vista without any problems. The source of the problem can be somewhere else. Try removing the call on SetForegroundWindow . If that does not work, just try to create an empty project with the popup menu code.
Comments
Post a Comment