SetActiveWindow for invible window, wih test.

Rein Klazes wijn at wanadoo.nl
Mon Dec 20 10:29:23 CST 2004


Hi,

This fixes the "properties" window of Visual Studio 6.

The test passes on Win2k.

Changelog:
	dlls/user	: focus.c
	dlls/user/tests	: win.c
	You can make an invisible window the active window.

Rein.
-------------- next part --------------
--- wine/dlls/user/focus.c	2004-12-09 19:07:46.000000000 +0100
+++ mywine/dlls/user/focus.c	2004-12-20 17:02:45.000000000 +0100
@@ -231,7 +231,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 );
--- wine/dlls/user/tests/win.c	2004-10-12 08:24:12.000000000 +0200
+++ mywine/dlls/user/tests/win.c	2004-12-20 17:10:32.000000000 +0100
@@ -1864,6 +1864,12 @@ static void test_SetActiveWindow(HWND hw
     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);


More information about the wine-patches mailing list