Child windows require IsWindowVisible() test in DestroyWindow()

Dmitry Timoshkov dmitry at baikal.ru
Thu Feb 24 10:06:52 CST 2005


Hello,

in the msg.c,test_DestroyWindow() test case adding WS_VISIBLE to all
windows except a parent shows that behaviour doesn't change for child
windows but a popup window starts to receive WM_WINDOWPOSCHANGING and
friends indicating that child windows require IsWindowVisible() test.

I don't want to add that to the real test in order to keep the test
as simple as possible.

Changelog:
    Dmitry Timoshkov <dmitry at codeweavers.com>
    A test shows that child windows require IsWindowVisible() test
    in DestroyWindow() in order to suppress ShowWindow() call.

--- cvs/hq/wine/windows/win.c	Sat Feb 19 03:12:18 2005
+++ wine/windows/win.c	Thu Feb 24 15:53:44 2005
@@ -1499,12 +1499,15 @@ BOOL WINAPI DestroyWindow( HWND hwnd )
         USER_Driver.pResetSelectionOwner( hwnd, FALSE ); /* before the window is unmapped */
 
       /* Hide the window */
-    if (GetWindowLongW( hwnd, GWL_STYLE ) & WS_VISIBLE)
+    /* Only child windows receive WM_SHOWWINDOW in DestroyWindow() */
+    if (is_child)
     {
-        /* Only child windows receive WM_SHOWWINDOW in DestroyWindow() */
-        if (is_child)
+        if (IsWindowVisible( hwnd ))
             ShowWindow( hwnd, SW_HIDE );
-        else
+    }
+    else
+    {
+        if (GetWindowLongW( hwnd, GWL_STYLE ) & WS_VISIBLE)
             SetWindowPos( hwnd, 0, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE |
                           SWP_NOZORDER | SWP_NOACTIVATE | SWP_HIDEWINDOW );
     }






More information about the wine-patches mailing list