Microsoft KB Archive/110793

From BetaArchive Wiki

BUG: SetWindowPlacement and ptMin.x or ptMax.x = -1

Q110793



The information in this article applies to:


  • Microsoft Win32 Software Development Kit (SDK)
  • Microsoft Windows Software Development Kit (SDK) 3.1





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. This was undocumented in the Windows 3.1 SDK documentation.



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 this to be a bug in the Microsoft products listed at the beginning of this article.

Additional query words:

Keywords : kbOSWinNT kbOSWin2000 kbOSWin2000bug kbSDKWin32 kbGrpDSUser kbWndw kbWndwProp
Issue type : kbbug
Technology : kbWin32SDKSearch kbAudDeveloper kbWin3xSearch kbSDKSearch kbWin32sSearch kbWinSDKSearch kbWinSDK310


Last Reviewed: July 7, 2000
© 2001 Microsoft Corporation. All rights reserved. Terms of Use.