//-------------------------主函数------------------------
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
// TODO: Place code here.
HWND hWnd;
MSG Message;
WNDCLASS WndClass;
char lpszClassName[]="编辑框";//为什么用数组来写名字
char lpszTitle[]="计算器";//为什么lpszTitle就能把计算器
WndClass.cbClsExtra=0;//这里为什么是0
WndClass.cbWndExtra=0;// 这里为什么是0
WndClass.hbrBackground=(HBRUSH)(GetStockObject(LTGRAY_BRUSH)); //设置窗体背景:亮灰色
WndClass.hCursor=LoadCursor(NULL,IDC_ARROW);
//WndClass.hIcon=LoadIcon(NULL,IDI_APPLICATION);
WndClass.hIcon=LoadIcon(NULL,"WinIcon");//这里为什么空值 WndClass.hInstance=hInstance;
WndClass.lpfnWndProc=WndProc; //消息处理
WndClass.lpszClassName=lpszClassName;
WndClass.lpszMenuName="Menu"; //加载菜单
WndClass.style=0;
if(!RegisterClass(&WndClass))//这是什么意思
{
MessageBeep(0);//这又是什么
return FALSE;
}
hInst=hInstance;//
hWnd=CreateWindow(
lpszClassName,
lpszTitle,
WS_OVERLAPPED | WS_SYSMENU | WS_MINIMIZEBOX,
CW_USEDEFAULT,
CW_USEDEFAULT,
210,230,
NULL,
NULL,
hInstance,
NULL
);
ShowWindow(hWnd,nCmdShow);
UpdateWindow(hWnd);
while(GetMessage(&Message,NULL,0,0))
{
TranslateMessage(&Message);
DispatchMessage(&Message);
}
return Message.wParam;
}帮我解释一下这段代吗,我只能大概猜到是什么,但太模糊