Once you create or load a mouse pointer, you can change its shape by calling WinSetPointer. Following are three typical situations in which an application changes the shape of the mouse pointer:
The following code fragment shows how to save the current mouse pointer, set the hourglass pointer, and restore the original mouse pointer. Notice that the hourglass pointer also is saved in a global variable so that the application can return it when responding to a WM_MOUSEMOVE message during a time-consuming process.
HPOINTER hptrOld, hptrWait, hptrCurrent; /* Get the current pointer. */ hptrOld = WinQueryPointer(HWND_DESKTOP); /* Get the wait mouse pointer. */ hptrWait = WinQuerySysPointer(HWND_DESKTOP, SPTR_WAIT, FALSE); /* Save the wait pointer to use in WM_MOUSEMOVE processing.*/ hptrCurrent = hptrWait; /* Set the mouse pointer to the wait pointer. */ WinSetPointer(HWND_DESKTOP, hptrWait); /* * Do a time-consuming operation, then restore the * original mouse pointer. */ WinSetPointer(HWND_DESKTOP, hptrOld);