2

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);
4

1 回答 1

1

我得到一个双箭头光标

这听起来像是库存游标之一,例如 IDC_SIZENS。这表明您的 hInst变量为 NULL。也许您应该使用 g_hInstance,从问题中并不清楚。

于 2012-07-09T09:50:53.717 回答