Thread: about window size

  1. #1
    Registered User
    Join Date
    Apr 2005
    Posts
    98

    about window size

    I create a window in the height of 691. Then i create a rectangle and fill it with some paint. The rectangle (which is the "STATIC" class actually) is also height 691, but the problem is that it exceed the window, I have to pull the border (to make it higher) pretty much in order to see its end.

    Any ideas what happening?

  2. #2
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    You are getting window size confused with client size. The window size is the entire window, which includes the borders, and title bar. The client size is the part of the window that you can actually draw on. When you draw your rectangle, call GetClientRect() to see the size of the client area which you can draw on.

  3. #3
    Registered User
    Join Date
    Apr 2005
    Posts
    98
    oh thanks

  4. #4
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    If you want the whole window to be 691 then call GetClientRect() and the area you can draw (client area) on will be returned (as Bithub says).

    If you want an area to draw on (client area) of 691 then look at AdjustWindowRect() to find the required window size.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

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