*/
static void IntSendDestroyMsg(HWND hWnd)
{
-
+ PTHREADINFO ti;
PWND Window;
-#if 0 /* FIXME */
- GUITHREADINFO info;
+ ti = PsGetCurrentThreadWin32Thread();
+ Window = UserGetWindowObject(hWnd);
- if (GetGUIThreadInfo(GetCurrentThreadId(), &info))
+ if (Window)
{
- if (hWnd == info.hwndCaret)
+ /* Look whether the focus is within the tree of windows we will
+ * be destroying.
+ */
+ // Rule #1
+ if ( ti->MessageQueue->spwndActive == Window ||
+ (ti->MessageQueue->spwndActive == NULL && ti->MessageQueue == IntGetFocusMessageQueue()) )
{
- DestroyCaret();
+ co_WinPosActivateOtherWindow(Window);
}
- }
-#endif
- Window = UserGetWindowObject(hWnd);
- if (Window)
- {
-// USER_REFERENCE_ENTRY Ref;
-// UserRefObjectCo(Window, &Ref);
-
- if (!Window->spwndOwner && !IntGetParent(Window))
+ if (ti->MessageQueue->CaretInfo->hWnd == UserHMGetHandle(Window))
{
- co_IntShellHookNotify(HSHELL_WINDOWDESTROYED, (WPARAM) hWnd, 0);
+ co_IntDestroyCaret(ti);
}
-// UserDerefObjectCo(Window);
}
- /* The window could already be destroyed here */
-
/*
* Send the WM_DESTROY to the window.
*/
Window->style &= ~WS_VISIBLE;
Window->head.pti->cVisWindows--;
- IntNotifyWinEvent(EVENT_OBJECT_DESTROY, Window, OBJID_WINDOW, CHILDID_SELF, 0);
/* remove the window already at this point from the thread window list so we
don't get into trouble when destroying the thread windows while we're still
BelongsToThreadData = IntWndBelongsToThread(Window, ThreadData);
- IntDeRegisterShellHookWindow(Window->head.h);
+ IntDeRegisterShellHookWindow(UserHMGetHandle(Window));
/* free child windows */
Children = IntWinListChildren(Window);
RDW_VALIDATE | RDW_NOFRAME | RDW_NOERASE |
RDW_NOINTERNALPAINT | RDW_NOCHILDREN);
if(BelongsToThreadData)
- co_IntSendMessage(Window->head.h, WM_NCDESTROY, 0, 0);
+ co_IntSendMessage(UserHMGetHandle(Window), WM_NCDESTROY, 0, 0);
}
DestroyTimersForWindow(ThreadData, Window);
/* Unregister hot keys */
- UnregisterWindowHotKeys (Window);
+ UnregisterWindowHotKeys(Window);
/* flush the message queue */
MsqRemoveWindowMessagesFromQueue(Window);
ThreadData->rpdesk->rpwinstaParent->ShellListView = NULL;
}
- /* FIXME: do we need to fake QS_MOUSEMOVE wakebit? */
-
-#if 0 /* FIXME */
-
- WinPosCheckInternalPos(Window->head.h);
- if (Window->head.h == GetCapture())
+ if (ThreadData->MessageQueue->spwndCapture == Window)
{
- ReleaseCapture();
+ IntReleaseCapture();
}
- /* free resources associated with the window */
- TIMER_RemoveWindowTimers(Window->head.h);
-#endif
-
if ( ((Window->style & (WS_CHILD|WS_POPUP)) != WS_CHILD) &&
Window->IDMenu &&
(Menu = UserGetMenuObject((HMENU)Window->IDMenu)))
}
DceFreeWindowDCE(Window); /* Always do this to catch orphaned DCs */
-#if 0 /* FIXME */
-
- WINPROC_FreeProc(Window->winproc, WIN_PROC_WINDOW);
- CLASS_RemoveWindow(Window->Class);
-#endif
IntUnlinkWindow(Window);
}
UserReferenceObject(Window);
- UserDeleteObject(Window->head.h, TYPE_WINDOW);
+ UserDeleteObject(UserHMGetHandle(Window), TYPE_WINDOW);
IntDestroyScrollBars(Window);
IntSendParentNotify(Window, WM_DESTROY);
}
- /* Look whether the focus is within the tree of windows we will
- * be destroying.
- */
- if (!co_WinPosShowWindow(Window, SW_HIDE))
- { // Rule #1.
- if ( ti->MessageQueue->spwndActive == Window ||
- (ti->MessageQueue->spwndActive == NULL && ti->MessageQueue == IntGetFocusMessageQueue()) )
+ if (!Window->spwndOwner && !IntGetParent(Window))
+ {
+ co_IntShellHookNotify(HSHELL_WINDOWDESTROYED, (WPARAM) hWnd, 0);
+ }
+
+ if (Window->style & WS_VISIBLE)
+ {
+ if (Window->style & WS_CHILD)
{
- co_WinPosActivateOtherWindow(Window);
+ co_WinPosShowWindow(Window, SW_HIDE);
+ }
+ else
+ {
+ co_WinPosSetWindowPos(Window, 0, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE|SWP_HIDEWINDOW );
}
}
pwndTemp->spwndLastActive = Window->spwndOwner;
}
- if (Window->spwndParent && IntIsWindow(Window->head.h))
+ if (Window->spwndParent && IntIsWindow(UserHMGetHandle(Window)))
{
if ((Window->style & (WS_POPUP | WS_CHILD)) == WS_CHILD)
{
IntEngWindowChanged(Window, WOC_DELETE);
- if (!IntIsWindow(Window->head.h))
+ if (!IntIsWindow(UserHMGetHandle(Window)))
{
return TRUE;
}
msg.pt = gpsi->ptCursor;
co_MsqInsertMouseMessage(&msg, 0, 0, TRUE);
+ IntNotifyWinEvent(EVENT_OBJECT_DESTROY, Window, OBJID_WINDOW, CHILDID_SELF, 0);
+
/* Send destroy messages */
- IntSendDestroyMsg(Window->head.h);
+ IntSendDestroyMsg(UserHMGetHandle(Window));
- if (!IntIsWindow(Window->head.h))
+ if (!IntIsWindow(UserHMGetHandle(Window)))
{
return TRUE;
}