BUG: SetWindowPlacement and ptMin.x or ptMax.x = -1
Article ID: 110793
Article Last Modified on 7/11/2005
APPLIES TO
- Microsoft Platform Software Development Kit-January 2000 Edition
This article was previously published under Q110793
SYMPTOMS
Passing an X coordinate value of -1 to SetWindowPlacement causes the
parameter to be ignored. If ptMinPosition.x is set to -1,
SetWindowPlacement won't reset the minimized window coordinate; this is
also true for ptMaxPosition.x.
CAUSE
This problem is caused by the use of -1 as a special value. A value of -1
in the X coordinate causes the API (application programming interface) to
use the window's current coordinate for the specified parameter.
RESOLUTION
This behavior may be a problem for application developers because they may
want to set the maximized or minimized horizontal coordinate of a window to
-1. To avoid this problem, the developer should trap values of -1, and use
a value of -2 or 0 (zero) as appropriate.
STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.
Keywords: kbbug kbwndwprop kbpending KB110793