include
long _stdcall p1(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 =p1;
a.lpszClassName ="center";
RegisterClass (&a);
h=CreateWindow ("center","press",WS_OVERLAPPEDWINDOW,100,200,500,300,0,0,i,0);
ShowWindow (h,l);
while(GetMessage (&m,0,0,0))
{
DispatchMessage (&m);
}
return 0;
}
long _stdcall p1(HWND w,UINT x,UINT y,long z)
{
HDC d;
PAINTSTRUCT p;
static POINT pt[1000];
int ct=0,b,n;
switch(x)
{
case WM_LBUTTONDOWN:
ct=0;
InvalidateRect (w,NULL,true);
return 0;
case WM_MOUSEMOVE:
if(y & MK_LBUTTON&&ct<1000) x ="LOWORD(z);" y ="HIWORD(z);" d="GetDC" d="BeginPaint(" b="0;b<
ct;b++
)
{
for( n=
b+1
;n<
ct;n++
)
{
MoveToEx (d,pt[ct].x,pt[ct].y,NULL);
LineTo (d,pt[ct].x,pt[ct].y);
}
}
EndPaint (w,&p);
return 0;
case WM_LBUTTONUP:
cnt=0;
InvalidateRect (w,NULL,false);
return 0;
case WM_DESTROY:
PostQuitMessage (0);
break;
default:
return DefWindowProc (w,x,y,z);
}
return 0;
}
OUTPUT
0 comments:
Post a Comment