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

    SetClientRect ???

    Hi,

    GetClient rect gives the rectangle of the client rect area, is there a way to set it ?

    I would like to reserve some space for one control in that space, I would like to use something like "SetWindowOrg", but the problem is that I create other controls outside of the OnDraw and this controls are inherited from CWnd and has its own painting methods...

    Is there a way to do this ?

    Thanks, Bye !
    Braulio


  2. #2
    Join Date
    May 1999
    Location
    CA, USA
    Posts
    586

    Re: SetClientRect ???

    Look at MoveWindow() and SetWindowPos().

    Rail

    ------------
    Recording Engineer/Software Developer
    Rail Jon Rogut Software
    http://home.earthlink.net/~railro/
    railro@earthlink.net

  3. #3
    Join Date
    Jul 2009
    Posts
    2

    Re: SetClientRect ???

    Process WM_NCCALCSIZE message. LPARAM is a long pointer to the client rectangle (TRECT).
    By adjusting the rectangle you can effectively change the client area of the window.

  4. #4
    Join Date
    Jul 2002
    Posts
    2,543

    Re: SetClientRect ???

    See AdjustWindowRectEx function. It allows to calculate the whole window size based on desired client size. Then use MoveWindow.

  5. #5
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,230

    Re: SetClientRect ???

    ...also you can use the MFC function CWnd::CalcWindowRect.
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpert.ro/blog/

  6. #6
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: SetClientRect ???

    This thread is 10 years old.

  7. #7
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,230

    Re: SetClientRect ???

    Quote Originally Posted by Skizmo View Post
    This thread is 10 years old.
    Huh?.. Oh, sorry!
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpert.ro/blog/

  8. #8
    Join Date
    Jul 2002
    Posts
    2,543

    Re: SetClientRect ???

    Quote Originally Posted by skizmo View Post
    this thread is 10 years old.
    OMG!
    I hope now Braulio can continue his work.
    Last edited by Alex F; July 13th, 2009 at 05:11 AM.

  9. #9
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,120

    Talking Re: SetClientRect ???

    Quote Originally Posted by Alex F View Post
    OMG!
    I hope now Braulio can continue his work.
    13 years later, and still the thread comes up, and the topic is relevant...
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

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