6/11/10

/*Basic Shapes*/

Buzz It
#include
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.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 p;
static POINT pt[9]={300,300,400,500,699,112,455,666,675};
switch(x)
{
case WM_PAINT:
d=BeginPaint (w,&p);
Rectangle (d,25,50,123,100);
MoveToEx(d,23,444,NULL);
LineTo(d,132,233);
RoundRect (d,135,140,260,225,20,20);
Ellipse (d,180,23,300,345);
Ellipse (d,234,55,666,779);
MoveToEx(d,300,300,NULL);
Polyline(d,pt,9);
EndPaint (w,&p);
return 0;
case WM_DESTROY:
PostQuitMessage (0);
break;
default:
return(DefWindowProc (w,x,y,z));

}
return 0;
}


O/P

0 comments:

Post a Comment