This function returns the pointer position.
#define INCL_WINPOINTERS /* Or use INCL_WIN, INCL_PM, */ #include <os2.h> HWND hwndDeskTop; /* Desktop-window handle. */ PPOINTL pptlPoint; /* Pointer position in screen coordinates. */ BOOL rc; /* Pointer position returned indicator. */ rc = WinQueryPointerPos(hwndDeskTop, pptlPoint);