R
Vielen Dank, der Tipp war Gold wert.
So funzt es:
GetCursorPos(&(this->CursorPosition)); /* get cursor position */
SetForegroundWindow(this->hOwnerWindow); /* brings the owner window to the top */
TrackPopupMenu(this->hPopupMenu, /* display the trayicon menu */
TPM_LEFTBUTTON, /* menu selection with the left button */
this->CursorPosition.x, /* x-coordinate */
this->CursorPosition.y, /* y-coordinate */
0, /* must be zero */
this->hOwnerWindow, /* window that owns the menu */
NULL); /* ignored */
PostMessage(this->hOwnerWindow, WM_NOICONFOCUS, 0, 0);
Das kommt davon, wenn man die Manuals nicht richtig studiert.
http://msdn2.microsoft.com/en-us/library/ms648002.aspx