You can make an invisible window the active window.
authorRein Klazes <wijn@wanadoo.nl>
Tue, 21 Dec 2004 14:36:32 +0000 (14:36 +0000)
committerAlexandre Julliard <julliard@winehq.org>
Tue, 21 Dec 2004 14:36:32 +0000 (14:36 +0000)
dlls/user/focus.c
dlls/user/tests/win.c

index ff779abd380be90110b97c40fe57ca1113f14163..619cd6d4992299d210e39b25836eaa705fe2c23d 100644 (file)
@@ -230,7 +230,7 @@ HWND WINAPI SetActiveWindow( HWND hwnd )
     {
         LONG style = GetWindowLongW( hwnd, GWL_STYLE );
 
-        if (!(style & WS_VISIBLE) || (style & (WS_POPUP|WS_CHILD)) == WS_CHILD)
+        if ((style & (WS_POPUP|WS_CHILD)) == WS_CHILD)
             return GetActiveWindow();  /* Windows doesn't seem to return an error here */
 
         hwnd = WIN_GetFullHandle( hwnd );
index 942aeca29e1e785945b9c2acc724671a647e4b38..2da2b6aeb4111c3d035d9109ab465a3e4452dd2a 100644 (file)
@@ -1864,6 +1864,12 @@ static void test_SetActiveWindow(HWND hwnd)
     SetWindowPos(hwnd,0,0,0,0,0,SWP_NOZORDER|SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE|SWP_SHOWWINDOW);
     ShowWindow(hwnd, SW_HIDE);
     ok( GetActiveWindow() != hwnd, "Window %p is still active\n", hwnd );
+
+    /* trace("**testing an invisible window now\n"); */
+    SetActiveWindow(hwnd);
+    ok( GetActiveWindow() == hwnd, "Window %p not active\n", hwnd );
+    ok( !(GetWindowLong(hwnd,GWL_STYLE) & WS_VISIBLE), "Window %p is visible\n", hwnd );
+    
     ShowWindow(hwnd, SW_SHOW);
 
     hwnd2 = CreateWindowExA(0, "static", NULL, WS_POPUP|WS_VISIBLE, 0, 0, 0, 0, hwnd, 0, 0, NULL);