GetClientRect strange behaviour

This is a discussion on GetClientRect strange behaviour within the Windows Programming forums, part of the Platform Specific Boards category; uhhmm...kinda strange: when I use GetClientRect it seems it subtracts 4 from the bottom. I've set the height to 100 ...

  1. #1
    btq
    btq is offline
    julie lexx... btq's Avatar
    Join Date
    Jun 2002
    Posts
    161

    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?

    thanks
    /btq

  2. #2
    Registered User
    Join Date
    Aug 2002
    Posts
    170
    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,

    Bonkey

  3. #3
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571
    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, 01:41 PM
  3. strange behaviour of sscanf
    By BeBu in forum C Programming
    Replies: 7
    Last Post: 12-17-2004, 09: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, 10:31 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21