Thursday, March 19, 2009

[VC++] Change cursor using SetClassLong()

You can use SetClassLong() function for changing/setting the cursor of your application. Here is how to do it.
SetClassLong( GetSafeHwnd(),
GCL_HCURSOR,
(LONG)LoadCursor(AfxGetInstanceHandle(),
MAKEINTRESOURCE( IDC_CURSOR1 )));
Please make sure that cursor resource IDC_CURSOR1 is created and available in the .rc file.

No comments: