Each time the cursor moves and mouse input is not captured, the system sends this message to the window in which the cursor is moving.
To prevent the class cursor from being redrawn, you must process the WM_SETCURSOR message. However, when the cursor moves, the system redraws the class cursor at the new location. Your application can change the design of the cursor by using the SetCursor function and specifying a different cursor handle.
#Windows 10 cursors windows
When the window class is registered, the cursor identified by 230 in the application's resource-definition file is the default cursor for all windows based on the class. Wc.lpszClassName = "GenericWClass" // class name Wc.lpszMenuName = "GenericMenu" // class menu Wc.hbrBackground = GetStockObject(WHITE_BRUSH) // class background Wc.hCursor = LoadCursor(hinst, MAKEINTRESOURCE(230)) // class cursor Wc.hIcon = LoadIcon(NULL, IDI_APPLICATION) // class icon Wc.hInstance = hinst // application that owns the class Wc.cbWndExtra = 0 // no per-window extra data Wc.cbClsExtra = 0 // no per-class extra data Wc.lpfnWndProc = (WNDPROC) MainWndProc // window procedure Fill the window class structure with parameters that The following example illustrates this by assigning a cursor handle to the hCursor member of the WNDCLASS structure identified by the wc parameter. You can assign a class cursor while registering a window class. The system automatically displays the class cursor (the cursor associated with the window to which the cursor is pointing). It is not necessary to destroy cursors created by other functions. AND maskīefore closing, you must use the Destro圜ursor function to destroy any cursors you created with CreateCursor. To create the cursor, CreateCursor applies the following truth table to the AND and XOR masks. HINSTANCE hinst // handle to current instance The example is included here to illustrate how the system interprets cursor masks. The following example uses the CreateCursor function to create a custom cursor at run time. Rather than create the cursors at run time, use the LoadCursor, LoadCursorFromFile, or LoadImage function to avoid device dependence, to simplify localization, and to enable applications to share cursor designs. You should implement custom cursors as resources. HCurs2 = LoadCursor(hinst, MAKEINTRESOURCE(240)) Create a custom cursor based on a resource.
The following example creates two cursor handles: one for the standard hourglass cursor and one for a custom cursor included as a resource in the application's resource-definition file.