CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    May 1999
    Location
    Spain
    Posts
    335

    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


  2. #2
    Join Date
    Apr 1999
    Posts
    306

    Re: GetClientRect and OnSize...

    Try MoveWindow(x1,y1,x2,y2);


  3. #3
    Join Date
    Apr 1999
    Posts
    396

    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).


  4. #4
    Join Date
    May 1999
    Location
    West Sussex, England
    Posts
    1,939

    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
    Please use meaningful question titles - "Help me" does not let me know whether I can help with your question, and I am unlikely to bother reading it.
    Please remember to rate useful answers. It lets us know when a question has been answered.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured