void CreateRectangles(int kletki,HWND hWnd)
{
HDC hdc;
RECT r;
int width=0;
int height=0;
GetWindowRect(hWnd,&r);
hdc=GetDC(hWnd);
HBRUSH hbr=(HBRUSH)GetStockObject(WHITE_BRUSH);
OffsetRect(&r,-r.left,-r.top);
FillRect(hdc,&r,hbr);
DeleteObject((HGDIOBJ)hbr);
GetWindowRect(hWnd,&r);
for (int i=0;i<kletki-1;i++) {
width+=(r.right-r.left) / (kletki);
height+=(r.bottom-r.top) / (kletki);
MoveToEx(hdc,width,0,(LPPOINT) NULL);
LineTo(hdc,width,r.bottom-r.top-2);
MoveToEx(hdc,0,height,(LPPOINT) NULL);
LineTo(hdc,r.right-r.left-2,height);
}
DeleteDC(hdc);
ReleaseDC(hWnd,hdc);
}
Slicer