Merge 16727 (ion/hbirr) from trunk:
- Message Queue Fix, resolves a number of application regressions (Total Commander works again, for example). Patch by Hartmut Birr. To be commited into 0.2.7 after more testing.
Modified: branches/ros-branch-0_2_7/reactos/subsys/win32k/ntuser/window.c

Modified: branches/ros-branch-0_2_7/reactos/subsys/win32k/ntuser/window.c
--- branches/ros-branch-0_2_7/reactos/subsys/win32k/ntuser/window.c	2005-08-03 17:07:01 UTC (rev 17010)
+++ branches/ros-branch-0_2_7/reactos/subsys/win32k/ntuser/window.c	2005-08-03 17:10:30 UTC (rev 17011)
@@ -1577,6 +1577,7 @@
       IntSetMenu(WindowObject, hMenu, &MenuChanged);
     }
   WindowObject->MessageQueue = PsGetWin32Thread()->MessageQueue;
+  IntReferenceMessageQueue(WindowObject->MessageQueue);
   WindowObject->Parent = (ParentWindow ? ParentWindow->Self : NULL);
   if((OwnerWindow = IntGetWindowObject(OwnerWindowHandle)))
   {
@@ -2180,7 +2181,7 @@
   if (Window->MessageQueue->CaptureWindow == Window->Self)
     Window->MessageQueue->CaptureWindow = NULL;
   IntUnLockMessageQueue(Window->MessageQueue);
-
+  IntDereferenceMessageQueue(Window->MessageQueue);
   /* Call hooks */
 #if 0 /* FIXME */
   if (HOOK_CallHooks(WH_CBT, HCBT_DESTROYWND, (WPARAM) hwnd, 0, TRUE))