Thread: Setting client area

  1. #1

    Setting client area

    Is there any way for me to set the region in which client controls can appear in my control?

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    Don't you control where all the controls are placed anyways?
    Or is this actually a rebar question?

    gg

  3. #3
    This is regarding my custom controls. I just wanted to be lazy and set a minimum offset for my controls and a clipping area and such which would clip all the controls say in the 'body' of the control leaving the caption and frame visible.

  4. #4
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    You might be able to use SelectClipRgn() to do something like that.
    There's an example there you can click on.

    gg

  5. #5
    Thanks.

  6. #6
    I had forgotten I had asked this question before, best just to revive the thread again I guess..

    Anyways, I'm even further into making custom controls now ... and I'm getting quite good at it (pure API) ... Now you can get the client rect of your window by using GetClientRect ... My question is: How can I set a rect like that for my own controls? I have found no function for this. ... It's not really something I need terribly but I would just like to know that I can do it if I need to.

  7. #7
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    The WM_NCCALCSIZE message is sent when the size and position of a window's client area must be calculated. By processing this message, an application can control the content of the window's client area when the size or position of the window changes.

    ...

    If wParam is FALSE, lParam points to a RECT structure. On entry, the structure contains the proposed window rectangle for the window. On exit, the structure should contain the screen coordinates of the corresponding window client area.
    Probably should let DefWindowProc handle this message when wParam is TRUE.

    Found by entering NC(for non-client) into help index which brought up NCCALCSIZE_PARAMS which links to WM_NCCALCSIZE.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. MFC: Clear Client Area
    By mrafcho001 in forum Windows Programming
    Replies: 2
    Last Post: 06-27-2005, 01:35 PM
  2. Displaying more shapes in the same client Area
    By sajeev_js in forum Windows Programming
    Replies: 1
    Last Post: 06-11-2005, 01:52 PM
  3. Help resizing client area
    By Unregistered in forum Windows Programming
    Replies: 4
    Last Post: 07-07-2002, 08:33 PM
  4. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM
  5. Clearing the client area
    By Isometric in forum Windows Programming
    Replies: 15
    Last Post: 01-29-2002, 10:07 PM