123456
GetCursorPos(&p); int iIndex = ListView_GetSelectionMark(hList); hMenu = CreatePopupMenu(); InsertMenu( hMenu, 0, MF_BYPOSITION | MF_STRING, 0, "Hello"); SetForegroundWindow( hwnd ); TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN, p.x, p.y, 0, hwnd, 0);
int ret = TrackPopupMenu(hMenu, TPM_RETURNCMD | TPM_TOPALIGN | TPM_LEFTALIGN, p.x, p.y, 0, hwnd, 0);