高手指点,短短几行代码,不知道问题在哪里
#include "stdafx.h"
#include "windows.h"
LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM);
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
static TCHAR szname[]=TEXT("IDD_DIALOG");
HWND hwnd;
MSG msg;
WNDCLASS wndclass;
// wndclass.style=CS_HREDRAW|CS_VREDRAW;
wndclass.lpfnWndProc=WndProc;
// wndclass.cbWndExtra=DLGWINDOWEXTRA;
// wndclass.cbClsExtra=0;
wndclass.hInstance=hInstance;
wndclass.hIcon=LoadIcon(hInstance,szname);
wndclass.hCursor=LoadCursor(NULL,IDC_ARROW);
wndclass.hbrBackground=(HBRUSH)(COLOR_BTNFACE+1);
wndclass.lpszMenuName=0;
wndclass.lpszClassName=szname;
RegisterClass(&wndclass);
hwnd=CreateDialog(hInstance,szname,0,NULL);
ShowWindow(hwnd,nCmdShow);
while(GetMessage(&msg,NULL,0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
LRESULT CALLBACK WndProc(HWND hwnd,UINT message,WPARAM wparam,LPARAM lparam)
{
switch(message)
{
case WM_CREATE:
break;
case WM_DESTROY:
break;
return 0;
}
return DefWindowProc(hwnd,message,wparam,lparam);
}
创建一个对话框,为什么对话框不出现,进程却创建了。