Thread: Window Size

  1. #1
    Registered User
    Join Date
    Aug 2003
    Posts
    288

    Window Size

    I just finished making this little test program to demonstrate my problem:

    This is a window run with the classic Windows XP style:

    http://mars.walagata.com/w/payne/Before.jpg

    And here is that same window run with the standard Windows XP style:

    http://mars.walagata.com/w/payne/After.jpg

    Now the thing is, the title bar is obviously bigger in the second program, but I dont understand why the client area of the program is now smaller.

    If anyone knows of a way to fix this, Id appreciate it.

    -PaYnE
    Last edited by X PaYnE X; 01-02-2004 at 06:25 AM.

  2. #2
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    One possible 'fix' is to handle the WM_SIZE event for the parent window and resize the child control to fit the parent's client dimensions, eg:
    Code:
    case WM_SIZE:
    {
    WORD cx,cy;
    cx=LOWORD(lParam);
    cy=HIWORD(lParam);
    /*use SetWindowPos or MoveWindow to resize */
    MoveWindow(hChildControl, 0, 0, cx, cy, 0);
    return 0;
    }
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C or C++
    By AcerN30 in forum Game Programming
    Replies: 41
    Last Post: 05-30-2008, 06:57 PM
  2. Just starting Windows Programming, School me!
    By Shamino in forum Windows Programming
    Replies: 17
    Last Post: 02-22-2008, 08:14 AM
  3. Why only 32x32? (OpenGL) [Please help]
    By Queatrix in forum Game Programming
    Replies: 2
    Last Post: 01-23-2006, 02:39 PM
  4. Adding colour & bmps to a Win 32 Window??
    By carey_sizer in forum Windows Programming
    Replies: 4
    Last Post: 09-04-2004, 05:55 PM
  5. opengl code not working
    By Unregistered in forum Windows Programming
    Replies: 4
    Last Post: 02-14-2002, 10:01 PM