GetWindowRect Function

HI,

below is a piece of code.

HWND  hVWnd;
RECT  rRect;

GetWindowRect(hVWnd,&rRect);
diff_val = rRect.bottom-rRect.top;

If on starting a application if my window is minimized then value of rRect.top and
rRect.bottom is -32000.

Is it a garbage value or any valid error code

Once my window get normal size it gives me a valid wondow cordinates. (such as 405, 395 ..)

my question is,
when a window is minimize then GetwindowRect's top propery is always -32000.

or it could be any other garbage value.

Waiting for your reply

Many thanks




Answer this question

GetWindowRect Function

  • Martin_TeroSolutions

    That means in all cases if window is minimized it will always returns -32000
    or its value may change if we change OS or upgrade with new service pack.



  • cherriesh

    I would post this on any of the windows forums as I won't be able to give 100% accurate answers.

    If it were for me, I woudn't depend on the exact number.

    Thanks,
      Ayman Shoukry
      VC++ Team.

  • gswitz

    The value -32000 is NOT a garbage one.  I believe coordinates could not be less than -32000 or greater than +32000.
     It could be a windows criteria where minimized windows are put into coordinates (-32000,-32000).

    I did a quick search and here is a blog that explained such issue:
    http://blogs.msdn.com/oldnewthing/archive/2004/10/28/249044.aspx

    Hope this helps!

    Thanks,
      Ayman Shoukry
      VC++ Team

  • Madhukar Bhalerao

    Thank for guiding me.



  • kdlady1974

    Many Thanks

  • GetWindowRect Function