The information in this article applies to:
SUMMARY
There are two different methods that an application can use to change
the mouse cursor in a window:
MORE INFORMATION
A number of factors should be considered during the design of an
application that changes the mouse cursor. The major consideration is
that Windows sends the WM_SETCURSOR message any time the mouse cursor
moves on the screen. Normally, Windows sends the message to the window
"under" the mouse cursor. However, if a window sets the mouse capture,
using the SetCapture function, that window receives all mouse
messages, without regard to the position of the mouse cursor.
prod(winsdk) and nonpreemptive and multitasking When the DefWindowProc or DefDlgProc function processes a WM_SETCURSOR message, it calls SetCursor to change the cursor to the default cursor for the application's window. The application can prevent the cursor from changing by processing the WM_SETCURSOR message. A typical application that processes WM_SETCURSOR will have a global variable for the handle to the current cursor. When the application receives a WM_SETCURSOR message, it checks the global variable. If the variable is NULL, the application passes the WM_SETCURSOR message to DefWindowProc. Otherwise, the application calls SetCursor with the value in the global variable. To return the cursor to the window default cursor, set the global variable to NULL. When Windows sends a WM_SETCURSOR message, it places the hit-test area code into the low-order word of the lParam parameter. The application can use the hit-test area code to determine what particular portion of the window is "under" the mouse cursor. For more information on the hit-test area codes, see the documentation for the WM_NCHITTEST message in the "Microsoft Windows Software Development Kit Reference Volume 1." Additional query words: 3.00 3.10 RegisterClass
Keywords : kb16bitonly kbInput kbMouse kbSDKPlatform kbWndw |
Last Reviewed: June 7, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |