Thread: Help please ! I'm going crazy with GetClientRect / GetWindowRect ...

  1. #1
    Registered User
    Join Date
    Feb 2004
    Posts
    10

    Help please ! I'm going crazy with GetClientRect / GetWindowRect ...

    Hi mates,

    I got a little problem:
    When i use SetWindowRgn i know that in win 2000:
    title bar height = 23 px
    Borders = 4 px

    then my custom shape is cutted why i know where is Client Rect

    CreateRectRgn (4,23,104,123); (i know title bar height in win2000 is 23px, but in XP change)

    But when i go in XP , the title bar height change...

    How can i get where Client Rect is positioned in Window Rect ??
    GetClientRect dont tell me where absolutely start on Window RECT...

    How can i retrieve Client Rect position to use in CreateRectRgn that work with any windows desktop theme ?

    (sorry 4 my bed english )

    TNX mates
    Last edited by jekko; 03-06-2004 at 12:34 PM.

  2. #2
    Registered User
    Join Date
    Feb 2004
    Posts
    10
    Ops... i think i have understand...

    How can i get titlebar With and Height with GetSystemMetrics ?

    TIA

  3. #3
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    Use ScreenToClient() and ClientToScreen() for conversions to and from screen and client coordinates.

    gg

  4. #4
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571
    Or you can use one of the following:

    Code:
    AdjustWindowRect( ); // For regular window styles
    AdjustWindowRectEx( ); // For extended window styles
    "...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

  5. #5
    Registered User
    Join Date
    Feb 2004
    Posts
    10

    jep...

    stupid me...


    thanks mates... this is exactly what i need !!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Crazy Errors, Bugs
    By Tonto in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 11-19-2006, 12:39 AM
  2. GetClientRect Issue
    By tyouk in forum Windows Programming
    Replies: 4
    Last Post: 01-11-2005, 03:44 PM
  3. crazy
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 23
    Last Post: 08-31-2002, 08:54 PM
  4. crazy output
    By asirep in forum C Programming
    Replies: 22
    Last Post: 04-09-2002, 11:41 AM
  5. Replies: 1
    Last Post: 02-24-2002, 06:24 PM