C++ 创建窗口 Windows ************************************************************************
登记自己的窗口类
************************************************************************/
bool registerMyClass() {
WNDCLASSEX wce = {0};
wce.cbSize = sizeof(wce);
wce.style = CS_VREDRAW | CS_HREDRAW;
wce.lpfnWndProc = &onMainWndMessage; //指明回调函数
wce.hInstance = GetModuleHandle(0);
wce.hIcon = LoadIcon(0, MAKEINTRESOURCE(IDI_WINLOGO));
wce.hCursor = LoadCursor(0, MAKEINTRESOURCE(IDC_ARROW));
wce.hbrBackground = reinterpret_cast<HBRUSH>(COLOR_BTNFACE+1);
wce.lpszClassName = CLASS_NAME; //独一无二的类名
wce.hIconSm = wce.hIcon;
return 0!=RegisterClassEx(&wce);
- 1
- 2
前往页