This example returns position and time of the the last message obtained from the current message queue.
#define INCL_WINMESSAGEMGR #define INCL_WINDIALOGS #include <OS2.H> #include <stdio.h> HAB hab; POINTL ptl; CHAR szMsg[100]; HWND hwnd; ULONG ulTime; WinQueryMsgPos(hab, &ptl); ulTime = WinQueryMsgTime(hab); sprintf(szMsg, "x = %ld y = %ld\n\ntime = %ld", ptl.x, ptl.y, ulTime); WinMessageBox(HWND_DESKTOP, hwnd, /* client-window handle */ szMsg, /* body of the message */ "Debugging information", /* title of the message */ 0, /* message box id */ MB_NOICON | MB_OK); /* icon and button flags */