#include<windows.h>
#include<stdio.h>
LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg,WPARAM wParam,LPARAM lParam);
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=LoadCursor(hInstance,IDC_APPSTARTING);
wnd.hIcon=LoadIcon(hInstance,IDI_APPLICATION);
wnd.hInstance=hInstance;
wnd.lpfnWndProc=WindowProc;
wnd.lpszClassName="welcome";
wnd.lpszMenuName=NULL;
wnd.style=CS_HREDRAW|CS_VREDRAW;
RegisterClass(&wnd);
HWND hwnd;
hwnd=CreateWindow("welcome",NULL,WS_OVERLAPPEDWINDOW,200,200,400,400,NULL,NULL,hInstance,NULL);
ShowWindow(hwnd,SW_SHOWDEFAULT);
UpdateWindow(hwnd);
MSG msg;
while(GetMessage(&msg,NULL,0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return 0;
}
LRESULT CALLBACK WindowProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
{
HDC hdc;
PAINTSTRUCT ps;
switch(msg)
{
case WM_PAINT:
hdc=BeginPaint(hwnd,&ps);
TextOut(hdc,0,100,"Hello World",strlen("Hello World"));
EndPaint(hwnd,&ps);
break;
    case WM_LBUTTONDOWN:
MessageBox(hwnd,"Good Luck To You","Application",MB_OK);
break;
    case WM_CHAR:
MessageBox(hwnd,"Good Luck To You","Application",MB_OK);
break;
    case WM_CLOSE:
if(IDYES==MessageBox(hwnd,"Quit?","Application",MB_YESNO))
{
DestroyWindow(hwnd);
}
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
    default:
return DefWindowProc(hwnd,msg,wParam,lParam);
}
return 0;
}