#include<windows.h>
LRESULT CALLBACK WndProc(HWND hWindow,UINT iMessage,WPARAM wParam,LPARAM lParam);
int WINAPIWinMain(HINSTANCE hInstance,HINSTANCE hPrevinst,LPSTR lpCmdLine,int nShowCmd)
{
WNDCLASS kWndClass;
kWndClass.hCursor=LoadCursor(NULL,IDC_ARROW);
kWndClass.hIcon=LoadIcon(NULL,IDI_APPLICATION);
kWndClass.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);
kWndClass.hInstance=hInstance;
kWndClass.lpfnWndProc=WndProc;
kWndClass.lpszClassName="windows";
kWndClass.lpszMenuName=NULL;
kWndClass.cbClsExtra=NULL;
kWndClass.style=NULL;
if(!RegisterClass(&kWndClass))
{
return -1;
}
HWND hWindow;
hWindow=CreateWindow("windows","windowss",WS_OVERLAPPEDWINDOW | WS_VISIBLE,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,NULL,NULL,hInstance,NULL);
MSG kMessage;
while(GetMessage(&kMessage,hWindow,0,0))
{
TranslateMessage(&kMessage);
DispatchMessage(&kMessage);
}
return 0;
}
LRESULT CALLBACK WndProc(HWND hWindow,UINT iMessage,WPARAM wParam,LPARAM lParam)
{
switch(iMessage)
{
case WM_CLOSE:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hWindow,iMessage,wParam,lParam);
}
return 0;
}