Results 1 to 3 of 3

Thread: GetWindowRect returns bogus values?

  1. #1
    DerFarm
    Guest

    Question GetWindowRect returns bogus values?

    I'm using the GetWindowRect(WindowHandle, Points) API to
    return the upperleft and lowerright corners of the window.

    The screen I'm looking at is the IE, maixmized to fit the entire
    screen.

    The values being returned are -4,-4 (left,top) and 804,604
    (right,bottom).

    I'm then passing these values to a proprietary DLL upon which VB
    gives me the message that the values are off the screen:

    "Rectangle is out of Window"

    When I reshape the points to be such that left and top are 0 and
    bottom and right are correspondingly modified (goes to 800,600)
    then the thing works fine.

    Question: Why is GetWindowRect returning bogus values?

  2. #2
    Frenzied Member MerrionComputin's Avatar
    Join Date
    Apr 2001
    Location
    Dublin, Ireland
    Posts
    1,616
    Try GetClientRect instead as this doe not include the window borders, which do go off screen a bit for some maximised windows...

    HTH,
    Duncan
    ----8<---------------------------------------
    NEW - The .NET printer queue monitor component
    ----8<---------------------------------------
    Now with Examples of use

  3. #3
    DerFarm
    Guest

    Talking

    FRABULOUS! Worked like a charm.

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width