Click to See Complete Forum and Search --> : GetClientRect and OnSize...


Braulio
June 14th, 1999, 03:13 AM
Hi,

I have a silly question..., GetClientRect, get the rectangle of the window without the window header ( and all this ****) ?, And OnSize, the parameter cy get the size of the window with or wihtout the header and.. ?, I'm trying to resize windows in a pretty way, and I have some problems..

Thanks, Bye !
Braulio

ric
June 14th, 1999, 08:29 AM
Try MoveWindow(x1,y1,x2,y2);

Todd Jeffreys
June 14th, 1999, 12:02 PM
GetClientRect and the CX and CY parameters of OnSize are the same. They are the size of the client rect (that rect minus the title bar, caption, edges).

Roger Allen
June 14th, 1999, 12:18 PM
When I have used GetClientRect() in the past it has always included the offset from the parents window as well. Has anybody else seen this problem?
I have to use this code :


CRect rect ;
CRect parent ;

GetClientRect(&rect) ;
GetParent()->GetWindowRect(&parent) ;
rect -= CPoint(parent.left, parent.top) ;




This gets the actual rectangle of the client area in client co-ordinates. Or can I just use ScreenToClient(&rect) to translate it correctly?


Roger Allen