2
我在WM_CREATE
中註冊了自定義按鈕,但我的自定義光標資源未被識別,並且在將鼠標懸停在運行時創建的自定義按鈕上時出現雙箭頭光標。任何解決方案我已經包含resource.h
並且檢查了自定義資源IC_CURSOR2
是否存在於資源中。定製光標不在自定義按鈕上顯示
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);
謝謝漢斯我把hInst改成全局g_hInstance,它解決了我的問題! :) – eric 2012-07-09 10:11:14