GetClientRect and OnSize...
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
Re: GetClientRect and OnSize...
Try MoveWindow(x1,y1,x2,y2);
Re: GetClientRect and OnSize...
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).
Re: GetClientRect and OnSize...
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