[ros-diffs] [mjmartin] 47224: [win32k] - The description and changes made regarding WM_ACTIVATEAPP messages in r47126 were partially incorrect, the code was mostly correct.

mjmartin at svn.reactos.org mjmartin at svn.reactos.org
Sat May 15 20:30:06 CEST 2010


Author: mjmartin
Date: Sat May 15 20:30:05 2010
New Revision: 47224

URL: http://svn.reactos.org/svn/reactos?rev=47224&view=rev
Log:
[win32k]
- The description and changes made regarding WM_ACTIVATEAPP messages in r47126 were partially incorrect, the code was mostly correct.



Modified:
    trunk/reactos/subsystems/win32/win32k/ntuser/focus.c

Modified: trunk/reactos/subsystems/win32/win32k/ntuser/focus.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntuser/focus.c?rev=47224&r1=47223&r2=47224&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/focus.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/focus.c [iso-8859-1] Sat May 15 20:30:05 2010
@@ -105,19 +105,43 @@
 
       if (Window && WindowPrev)
       {
+         PWINDOW_OBJECT cWindow;
+         HWND *List, *phWnd;
          HANDLE OldTID = IntGetWndThreadId(WindowPrev);
          HANDLE NewTID = IntGetWndThreadId(Window);
 
          DPRINT1("SendActiveMessage Old -> %x, New -> %x\n", OldTID, NewTID);
          if (Window->Wnd->style & WS_MINIMIZE)
          {
-            DPRINT1("Widow was nminimized\n");
+            DPRINT("Widow was minimized\n");
          }
 
          if (OldTID != NewTID)
          {
-            co_IntSendMessageNoWait(hWndPrev, WM_ACTIVATEAPP, FALSE, (LPARAM)NewTID);
-            co_IntSendMessageNoWait(hWnd, WM_ACTIVATEAPP, TRUE, (LPARAM)OldTID);
+            List = IntWinListChildren(UserGetWindowObject(IntGetDesktopWindow()));
+            if (List)
+            {
+               for (phWnd = List; *phWnd; ++phWnd)
+               {
+                  cWindow = UserGetWindowObject(*phWnd);
+
+                  if (cWindow && (IntGetWndThreadId(cWindow) == OldTID))
+                  {  // FALSE if the window is being deactivated,
+                     // ThreadId that owns the window being activated.
+                    co_IntSendMessageNoWait(*phWnd, WM_ACTIVATEAPP, FALSE, (LPARAM)NewTID);
+                  }
+               }
+               for (phWnd = List; *phWnd; ++phWnd)
+               {
+                  cWindow = UserGetWindowObject(*phWnd);
+                  if (cWindow && (IntGetWndThreadId(cWindow) == NewTID))
+                  { // TRUE if the window is being activated,
+                    // ThreadId that owns the window being deactivated.
+                    co_IntSendMessageNoWait(*phWnd, WM_ACTIVATEAPP, TRUE, (LPARAM)OldTID);
+                  }
+               }
+               ExFreePool(List);
+            }
          }
          UserDerefObjectCo(WindowPrev); // Now allow the previous window to die.
       }




More information about the Ros-diffs mailing list