为什么注册不了窗口类
部分代码
int WINAPI WinMain(
HINSTANCE hInstance, // handle to current instance
HINSTANCE hPrevInstance, // handle to previous instance
LPSTR lpCmdLine, // command line
int nCmdShow // show state
)
{
WNDCLASS wnd;
wnd.cbClsExtra=0;
wnd.cbWndExtra=0;
wnd.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);
wnd.hCursor=LoadCursorA(NULL,IDC_ARROW);
wnd.hIcon=LoadIconA(NULL,IDI_APPLICATION);
wnd.hInstance=hInstance;
wnd.lpfnWndProc=winproc;
wnd.lpszClassName="window";
wnd.lpszMenuName=NULL;
wnd.style=CS_VREDRAW;
RegisterClass(&wnd);
if(!RegisterClass(&wnd))
{
MessageBox (NULL,TEXT("This program requires Windows NT!"),
"AppName", MB_ICONERROR);
return 0;
}
运行时提示This program requires Windows NT!