[C++] 纯文本查看 复制代码
typedef struct {
UINT cbSize;
UINT style;
WNDPROC lpfnWndProc;
int cbClsExtra;
int cbWndExtra;
HINSTANCE hInstance;
HICON hIcon;
HCURSOR hCursor;
HBRUSH hbrBackground;
LPCTSTR lpszMenuName;
LPCTSTR lpszClassName;
HICON hIconSm;
} WNDCLASSEX, *PWNDCLASSEX;
[C++] 纯文本查看 复制代码
ATOM MyRegisterClass(HINSTANCE hInstance)
{
WNDCLASSEX mywcex;
mywcex.cbSize = sizeof(WNDCLASSEX);
mywcex.style = CS_HREDRAW | CS_VREDRAW;
mywcex.lpfnWndProc = WndProc;
mywcex.cbClsExtra = 0;
mywcex.cbWndExtra = 0;
mywcex.hInstance = hInstance;
mywcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON1));
//mywcex.hIcon = LoadIcon(NULL, IDI_ERROR);
mywcex.hCursor = LoadCursor(NULL, IDC_ARROW);
mywcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
mywcex.lpszMenuName = MAKEINTRESOURCE(IDC_WIN32MAIN);
mywcex.lpszClassName = szWindowClass;
mywcex.hIconSm = NULL;//LoadIcon(mywcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));
return RegisterClassEx(&mywcex);
}