如何添加自定义类的按钮?
guww 2004-06-13 11:00:28 用这段代码可以动态添加按钮
HWND hwndButton = CreateWindow(
"BUTTON", // predefined class
"MyButton", // button text
WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,
10,//r.left,
4,//r.top,
80,//r.right - r.left,
20,//r.bottom - r.top,
hwnd,
NULL,
(HINSTANCE) GetWindowLong(hwnd, GWL_HINSTANCE),
NULL);
但自定义的类(按钮)为何不行?
HWND hwndButton = CreateWindow(
"CMYBUTTON", // predefined class
"MyButton", // button text
WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,
rect.Width() - 83,//r.left,
4,//r.top,
80,//r.right - r.left,
20,//r.bottom - r.top,
hwnd,
NULL,
(HINSTANCE) GetWindowLong(hwnd, GWL_HINSTANCE),
NULL);