long _stdcall me(HWND,UINT,UINT,long);
WNDCLASS a;
int _stdcall WinMain(HINSTANCE i,HINSTANCE j,char * k,int l)
{
HWND h;
MSG m;
a.style =CS_HREDRAWCS_VREDRAW;
a.hbrBackground =(HBRUSH)GetStockObject(WHITE_BRUSH);
a.hCursor =LoadCursor (0,IDC_ARROW);
a.hInstance =i;
a.lpfnWndProc =me;
a.lpszClassName ="center";
RegisterClass (&a);
h=CreateWindow ("center","press",WS_OVERLAPPEDWINDOW,20,30,400,500,0,0,i,0);
ShowWindow (h,l);
while(GetMessage (&m,0,0,0))
{
DispatchMessage (&m);
}
return 0;
}
long _stdcall me(HWND w,UINT x,UINT y,long z)
{
HDC d;
PAINTSTRUCT ps;
RECT r;
switch(x)
{
case WM_PAINT:
d=BeginPaint(w,&ps);
GetClientRect (w,&r);
DrawText(d,"hello",4,&r,DT_SINGLELINEDT_CENTERDT_VCENTER);
EndPaint(w,&ps);
break;
case WM_DESTROY:
PostQuitMessage (0);
break;
default:
return(DefWindowProc (w,x,y,z));
}
return 0;
}
OUTPUT
0 comments:
Post a Comment