This example displays the pointer position.

#define INCL_WINWINDOWMGR
#define INCL_WINPOINTERS
#include <OS2.H>

HWND   hwndClient;
CHAR   szMsg[100];
POINTL ptl;

 WinQueryPointerPos(HWND_DESKTOP, &ptl);
 sprintf(szMsg, "x = ld   y = ld", ptl.x, ptl.y);
 WinMessageBox(HWND_DESKTOP,
               hwndClient,                /* 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 */


[Back] [Next]