Popup menu from taskbar icon
Posted on 1999-11-11
My program does the following when the user clicks the program's icon in the taskbar's tray area:
hMenu = CreatePopupMenu();
AppendMenu(hMenu, MF_STRING, ID1, "Title1");
AppendMenu(hMenu, MF_STRING, ID16, "Title16");
TPM_RIGHTALIGN | TPM_BOTTOMALIGN | TPM_LEFTBUTTON | TPM_RIGHTBUTTON,
pt.x, pt.y, 0, g_hwndMain, 0);
SendMessage(g_hwndMain, 0, 0, 0);
The popup menu hides after I click somewhere outside the menu, but it doesn't appeat next time I click the icon. Only on second or third time.
What should I do to correct this ?