I registered a custom button in WM_CREATE
but my custom cursor resource is not recognized and I am getting a double arrow cursor when hovering over the custom buttons that I create at run time. Any solutions? I have included resource.h
and triplechecked that the custom resource with IC_CURSOR2
is there in the resources.
WNDCLASSEX buttonx; //subclass our custom buttons
buttonx.cbSize = sizeof(WNDCLASSEX);
GetClassInfoEx(NULL,TEXT("BUTTON"), &buttonx);
buttonx.lpszClassName = "CustomButton";
buttonx.hInstance = hInst;
buttonx.hCursor = LoadCursor(hInst, MAKEINTRESOURCE(IDC_CURSOR2));
RegisterClassEx(&buttonx);
hButton1 = CreateWindowEx(NULL, "CustomButton", "Close", WS_CHILD
| WS_VISIBLE | BS_OWNERDRAW, 410, 570, 100, 30, hWnd,
(HMENU)ID_BUTTON1, g_hInstance, NULL);