6/11/10

/*Fill shape*/

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 (NULL,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 HPEN hp;
switch(x)
{
case WM_CREATE:
{
hp=CreatePen (PS_SOLID,3,RGB(255,0,244));
break;
}
case WM_PAINT:
{
d=BeginPaint (w,&p);
SelectObject (d,hp);
SelectObject (d,GetStockObject(GRAY_BRUSH));
Rectangle (d,25,50,123,100);
RoundRect (d,135,140,260,225,20,20);
Ellipse (d,180,23,300,345);
Ellipse (d,234,55,666,779);
EndPaint (w,&p);
break;
}
case WM_DESTROY:
{
PostQuitMessage (0);
break;
}
default:
{
return(DefWindowProc (w,x,y,z));
}

}
return 0;
}

O/P


0 comments:

Post a Comment