BUG: CWindow::GetTopLevelWindow() returns NULLLast reviewed: June 25, 1997Article ID: Q168123 |
The information in this article applies to:
SYMPTOMSA call to CWindow::GetTopLevelWindow() always returns NULL.
CAUSEThis is due to a bug in the function.
RESOLUTIONChange the function in AtlWin.cpp from:
HWND CWindow::GetTopLevelWindow() const { ... while(hWndTmp != NULL) { hWndTmp = (::GetWindowLong(hWndParent, GWL_STYLE) & WS_CHILD) ? ::GetParent(hWndParent) : ::GetWindow(hWndParent, GW_OWNER); hWndParent = hWndTmp; } return hWndParent; }to:
HWND CWindow::GetTopLevelWindow() const { ... while(hWndTmp != NULL) { // Modification hWndParent = hWndTmp; hWndTmp = (::GetWindowLong(hWndParent, GWL_STYLE) & WS_CHILD) ? ::GetParent(hWndParent) : ::GetWindow(hWndParent, GW_OWNER); } return hWndParent; } STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available. (c) Microsoft Corporation 1997, All Rights Reserved. Contributions by Sridhar Madhugiri, Microsoft Corporation
|
Additional query words: GetTopLevelWindow NULL
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |