Thread: GetClientRect strange behaviour

  1. #1
    julie lexx... btq's Avatar
    Join Date
    Jun 2002

    GetClientRect strange behaviour

    uhhmm...kinda strange:
    when I use GetClientRect it seems it subtracts 4 from the bottom.
    I've set the height to 100 in CreateWindow and only receive 96.
    If I set it to 300 i recieve 296 as bottom...
    anyone familiar with this?


  2. #2
    Registered User
    Join Date
    Aug 2002
    Not sure if this is what you are seeing, but commands that use the word client refer only to the inside of the window not the entire window. Like GetDC and GetClientDC have this distinction. I would assume this is what you are seeing.
    Best Regards,


  3. #3
    Registered User
    Join Date
    Apr 2002
    GetClientRect returns how big the DRAWABLE part of the window is. Obviously you cannot draw on the title bar of the window so it does not count this. That is why it is a little off. If you want the full size of the WINDOW then use GetWindowRect.
    "...the results are undefined, and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces." --Scott Meyers

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Strange behaviour of Ternary
    By Ducky in forum C++ Programming
    Replies: 3
    Last Post: 03-19-2009, 02:17 AM
  2. Strange behaviour of scanf()
    By chris1985 in forum C Programming
    Replies: 3
    Last Post: 01-15-2005, 02:41 PM
  3. strange behaviour of sscanf
    By BeBu in forum C Programming
    Replies: 7
    Last Post: 12-17-2004, 10:12 AM
  4. Strange behaviour
    By PrivatePanic in forum Windows Programming
    Replies: 11
    Last Post: 07-23-2002, 12:54 AM
  5. strange behaviour by rhide
    By ustuzou in forum C++ Programming
    Replies: 0
    Last Post: 03-17-2002, 11:31 AM