mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
make SetShellwindow() implementation more complete
svn path=/trunk/; revision=6348
This commit is contained in:
parent
31c01ee91a
commit
fb9b3cb9c2
2 changed files with 34 additions and 17 deletions
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: window.c,v 1.113 2003/10/15 20:48:19 weiden Exp $
|
/* $Id: window.c,v 1.114 2003/10/17 17:38:38 mf Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -69,7 +69,6 @@ static LIST_ENTRY RegisteredMessageListHead;
|
||||||
/* globally stored handles to the shell windows */
|
/* globally stored handles to the shell windows */
|
||||||
HWND hwndShellWindow = 0;
|
HWND hwndShellWindow = 0;
|
||||||
HWND hwndShellListView = 0;
|
HWND hwndShellListView = 0;
|
||||||
DWORD pidShellWindow = 0;
|
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS FASTCALL
|
NTSTATUS FASTCALL
|
||||||
|
@ -209,6 +208,13 @@ static LRESULT IntDestroyWindow(PWINDOW_OBJECT Window,
|
||||||
NtUserSendMessage(Window->Self, WM_NCDESTROY, 0, 0);
|
NtUserSendMessage(Window->Self, WM_NCDESTROY, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* reset shell window handles */
|
||||||
|
if (Window->Self == hwndShellWindow)
|
||||||
|
hwndShellWindow = 0;
|
||||||
|
|
||||||
|
if (Window->Self == hwndShellListView)
|
||||||
|
hwndShellListView = 0;
|
||||||
|
|
||||||
/* FIXME: do we need to fake QS_MOUSEMOVE wakebit? */
|
/* FIXME: do we need to fake QS_MOUSEMOVE wakebit? */
|
||||||
|
|
||||||
#if 0 /* FIXME */
|
#if 0 /* FIXME */
|
||||||
|
@ -1971,7 +1977,7 @@ NtUserGetParent(HWND hWnd)
|
||||||
HWND STDCALL
|
HWND STDCALL
|
||||||
NtUserGetShellWindow()
|
NtUserGetShellWindow()
|
||||||
{
|
{
|
||||||
return hwndShellWindow;
|
return hwndShellWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2711,23 +2717,29 @@ NtUserSetParent(HWND hWndChild, HWND hWndNewParent)
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
DWORD STDCALL
|
DWORD STDCALL
|
||||||
NtUserSetShellWindowEx(HWND hwndShell, HWND hwndShellListView)
|
NtUserSetShellWindowEx(HWND hwndShell, HWND hwndListView)
|
||||||
{
|
{
|
||||||
PEPROCESS my_current = IoGetCurrentProcess();
|
/* test if we are permitted to change the shell window */
|
||||||
|
if (hwndShellWindow)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
/* test if we are permitted to change the shell window */
|
/* move shell window into background */
|
||||||
if (pidShellWindow && my_current->UniqueProcessId!=pidShellWindow)
|
if (hwndListView && hwndListView!=hwndShell) {
|
||||||
return FALSE;
|
WinPosSetWindowPos(hwndListView, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE);
|
||||||
|
|
||||||
hwndShellWindow = hwndShell;
|
if (NtUserGetWindowLong(hwndListView, GWL_EXSTYLE, FALSE) & WS_EX_TOPMOST)
|
||||||
hwndShellListView = hwndShellListView;
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if (hwndShell)
|
if (NtUserGetWindowLong(hwndShell, GWL_EXSTYLE, FALSE) & WS_EX_TOPMOST)
|
||||||
pidShellWindow = my_current->UniqueProcessId; /* request shell window for the calling process */
|
return FALSE;
|
||||||
else
|
|
||||||
pidShellWindow = 0; /* shell window is now free for other processes. */
|
|
||||||
|
|
||||||
return TRUE;
|
WinPosSetWindowPos(hwndShell, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE);
|
||||||
|
|
||||||
|
hwndShellWindow = hwndShell;
|
||||||
|
hwndShellListView = hwndListView;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2824,6 +2836,11 @@ NtUserSetWindowLong(HWND hWnd, DWORD Index, LONG NewValue, BOOL Ansi)
|
||||||
OldValue = (LONG) WindowObject->ExStyle;
|
OldValue = (LONG) WindowObject->ExStyle;
|
||||||
Style.styleOld = OldValue;
|
Style.styleOld = OldValue;
|
||||||
Style.styleNew = NewValue;
|
Style.styleNew = NewValue;
|
||||||
|
|
||||||
|
/* remove extended window style bit WS_EX_TOPMOST for shell windows */
|
||||||
|
if (hWnd==hwndShellWindow || hWnd==hwndShellListView)
|
||||||
|
Style.styleNew &= ~WS_EX_TOPMOST;
|
||||||
|
|
||||||
IntSendSTYLECHANGINGMessage(hWnd, GWL_EXSTYLE, &Style);
|
IntSendSTYLECHANGINGMessage(hWnd, GWL_EXSTYLE, &Style);
|
||||||
WindowObject->ExStyle = (DWORD)Style.styleNew;
|
WindowObject->ExStyle = (DWORD)Style.styleNew;
|
||||||
IntSendSTYLECHANGEDMessage(hWnd, GWL_EXSTYLE, &Style);
|
IntSendSTYLECHANGEDMessage(hWnd, GWL_EXSTYLE, &Style);
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: winpos.c,v 1.31 2003/09/21 06:44:51 gvg Exp $
|
/* $Id: winpos.c,v 1.32 2003/10/17 17:38:38 mf Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -662,7 +662,7 @@ WinPosSetWindowPos(HWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx,
|
||||||
WvrFlags = WinPosDoNCCALCSize(Window, &WinPos, &NewWindowRect,
|
WvrFlags = WinPosDoNCCALCSize(Window, &WinPos, &NewWindowRect,
|
||||||
&NewClientRect);
|
&NewClientRect);
|
||||||
|
|
||||||
/* FIXME: Relink windows. */
|
/* FIXME: Relink windows. (also take into account shell window in hwndShellWindow) */
|
||||||
|
|
||||||
/* FIXME: Reset active DCEs */
|
/* FIXME: Reset active DCEs */
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue