The following code fragment shows how an application should respond to a WM_SETFOCUS message when using a cursor in a particular window:
LONG curXPos,curYPos,curWidth,curHeight; case WM_SETFOCUS: if (SHORT1FROMMP(mp2)) { /* Gain the focus. */ WinCreateCursor(hwnd, curXPos, curYPos, curWidth, curHeight, CURSOR_SOLID | CURSOR_FLASH, (PRECTL) NULL); WinShowCursor(hwnd, TRUE); } else { /* Lose the focus. */ WinDestroyCursor(hwnd); } return 0;