I have the following code and it show that the TrackPopupMenu is not working as expected.

PHP Code:
DWORD WINAPI PopupMenuThread(LPVOID pParam)
{
    
DWORD    id;
    
POINT    pt;
    
HMENU    hMenu2;

    
hMenu2 CreatePopupMenu();
    
AppendMenu(hMenu2MF_STRINGID_OPTION_INFORMATION2"Information 2");
    
AppendMenu(hMenu2MF_STRINGID_OPTION_RESERVATION2"Reservation 2");
    
AppendMenu(hMenu2MF_SEPARATOR0NULL);
    
AppendMenu(hMenu2MF_STRINGID_OPTION_GAMES2"Games 2");

    
GetCursorPos(&pt);
    
id TrackPopupMenu(hMenu2TPM_RETURNCMD TPM_TOPALIGNpt.xpt.y0hWndMainNULL);
    switch(
id)
    {
        case 
ID_OPTION_INFORMATION:
            
MessageBox(hWndMain"1""###"MB_OK);
            break;
        case 
ID_OPTION_RESERVATION:
            
MessageBox(hWndMain"2""###"MB_OK);
            break;
        case 
ID_OPTION_GAMES:
            
MessageBox(hWndMain"3""###"MB_OK);
            break;
        default:
            break;
    }

    
DestroyMenu(hMenu2);

    return 
0;

Can someone give me some hints on how to resolve this?

regards,