DOCERR: GetWindowPlacement Function Always Returns an ErrorLast reviewed: January 26, 1996Article ID: Q89569 |
The information in this article applies to:
SYMPTOMSWhen an application developed for the Microsoft Windows graphical environment uses the GetWindowPlacement() function to retrieve the show state and position information for a window, the function always returns FALSE, indicating an error.
CAUSEThe length member of the specified WINDOWPLACEMENT data structure is not initialized.
RESOLUTIONInitialize the length member and call the GetWindowPlacement() function as follows:
BOOL bResult; WINDOWPLACEMENT lpWndPl; lpWndPl.length = sizeof(WINDOWPLACEMENT); bResult = GetWindowPlacement(hWnd, &lpWndPl); MORE INFORMATIONThe need to initialize the length member of the WINDOWPLACEMENT structure is documented on page 422 of the Microsoft Windows Software Development Kit (SDK) "Programmer's Reference, Volume 3: Messages, Structures, and Macros" manual for version 3.1. This information is not listed in the documentation for the GetWindowPlacement() function on page 479 of the "Programmer's Reference, Volume 2: Functions" manual.
|
Additional reference words: 3.10 3.50 3.51 4.00 95
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |