mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 14:03:02 +00:00
[Win32k|User32]
- Add hack to mark desktop window as a desktop window and notes for creating a desktop with tips in win32k. Move user position code from window to winpos. svn path=/trunk/; revision=50229
This commit is contained in:
parent
37fdeb8a46
commit
cb0b5d3b3a
5 changed files with 132 additions and 95 deletions
|
@ -1831,92 +1831,6 @@ UpdateLayeredWindowIndirect(HWND hwnd,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @implemented
|
|
||||||
*/
|
|
||||||
HWND WINAPI
|
|
||||||
WindowFromPoint(POINT Point)
|
|
||||||
{
|
|
||||||
//TODO: Determine what the actual parameters to
|
|
||||||
// NtUserWindowFromPoint are.
|
|
||||||
return NtUserWindowFromPoint(Point.x, Point.y);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @implemented
|
|
||||||
*/
|
|
||||||
int WINAPI
|
|
||||||
MapWindowPoints(HWND hWndFrom, HWND hWndTo, LPPOINT lpPoints, UINT cPoints)
|
|
||||||
{
|
|
||||||
PWND FromWnd, ToWnd;
|
|
||||||
POINT Delta;
|
|
||||||
UINT i;
|
|
||||||
|
|
||||||
FromWnd = ValidateHwndOrDesk(hWndFrom);
|
|
||||||
if (!FromWnd)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
ToWnd = ValidateHwndOrDesk(hWndTo);
|
|
||||||
if (!ToWnd)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
Delta.x = FromWnd->rcClient.left - ToWnd->rcClient.left;
|
|
||||||
Delta.y = FromWnd->rcClient.top - ToWnd->rcClient.top;
|
|
||||||
|
|
||||||
for (i = 0; i != cPoints; i++)
|
|
||||||
{
|
|
||||||
lpPoints[i].x += Delta.x;
|
|
||||||
lpPoints[i].y += Delta.y;
|
|
||||||
}
|
|
||||||
|
|
||||||
return MAKELONG(LOWORD(Delta.x), LOWORD(Delta.y));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @implemented
|
|
||||||
*/
|
|
||||||
BOOL WINAPI
|
|
||||||
ScreenToClient(HWND hWnd, LPPOINT lpPoint)
|
|
||||||
{
|
|
||||||
PWND Wnd, DesktopWnd;
|
|
||||||
|
|
||||||
Wnd = ValidateHwnd(hWnd);
|
|
||||||
if (!Wnd)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
DesktopWnd = GetThreadDesktopWnd();
|
|
||||||
|
|
||||||
lpPoint->x += DesktopWnd->rcClient.left - Wnd->rcClient.left;
|
|
||||||
lpPoint->y += DesktopWnd->rcClient.top - Wnd->rcClient.top;
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @implemented
|
|
||||||
*/
|
|
||||||
BOOL WINAPI
|
|
||||||
ClientToScreen(HWND hWnd, LPPOINT lpPoint)
|
|
||||||
{
|
|
||||||
PWND Wnd, DesktopWnd;
|
|
||||||
|
|
||||||
Wnd = ValidateHwnd(hWnd);
|
|
||||||
if (!Wnd)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
DesktopWnd = GetThreadDesktopWnd();
|
|
||||||
|
|
||||||
lpPoint->x += Wnd->rcClient.left - DesktopWnd->rcClient.left;
|
|
||||||
lpPoint->y += Wnd->rcClient.top - DesktopWnd->rcClient.top;
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
@ -1927,7 +1841,6 @@ SetWindowContextHelpId(HWND hwnd,
|
||||||
return NtUserSetWindowContextHelpId(hwnd, dwContextHelpId);
|
return NtUserSetWindowContextHelpId(hwnd, dwContextHelpId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
/* $Id$
|
/*
|
||||||
*
|
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS user32.dll
|
* PROJECT: ReactOS user32.dll
|
||||||
* FILE: lib/user32/windows/window.c
|
* FILE: dll/win32/user32/windows/winpos.c
|
||||||
* PURPOSE: Window management
|
* PURPOSE: Window management
|
||||||
* PROGRAMMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
|
* PROGRAMMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
|
||||||
* UPDATE HISTORY:
|
* UPDATE HISTORY:
|
||||||
|
@ -111,3 +110,88 @@ ArrangeIconicWindows(HWND hWnd)
|
||||||
{
|
{
|
||||||
return NtUserCallHwndLock( hWnd, HWNDLOCK_ROUTINE_ARRANGEICONICWINDOWS);
|
return NtUserCallHwndLock( hWnd, HWNDLOCK_ROUTINE_ARRANGEICONICWINDOWS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
HWND WINAPI
|
||||||
|
WindowFromPoint(POINT Point)
|
||||||
|
{
|
||||||
|
//TODO: Determine what the actual parameters to
|
||||||
|
// NtUserWindowFromPoint are.
|
||||||
|
return NtUserWindowFromPoint(Point.x, Point.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
int WINAPI
|
||||||
|
MapWindowPoints(HWND hWndFrom, HWND hWndTo, LPPOINT lpPoints, UINT cPoints)
|
||||||
|
{
|
||||||
|
PWND FromWnd, ToWnd;
|
||||||
|
POINT Delta;
|
||||||
|
UINT i;
|
||||||
|
|
||||||
|
FromWnd = ValidateHwndOrDesk(hWndFrom);
|
||||||
|
if (!FromWnd)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
ToWnd = ValidateHwndOrDesk(hWndTo);
|
||||||
|
if (!ToWnd)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
Delta.x = FromWnd->rcClient.left - ToWnd->rcClient.left;
|
||||||
|
Delta.y = FromWnd->rcClient.top - ToWnd->rcClient.top;
|
||||||
|
|
||||||
|
for (i = 0; i != cPoints; i++)
|
||||||
|
{
|
||||||
|
lpPoints[i].x += Delta.x;
|
||||||
|
lpPoints[i].y += Delta.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
return MAKELONG(LOWORD(Delta.x), LOWORD(Delta.y));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
BOOL WINAPI
|
||||||
|
ScreenToClient(HWND hWnd, LPPOINT lpPoint)
|
||||||
|
{
|
||||||
|
PWND Wnd, DesktopWnd;
|
||||||
|
|
||||||
|
Wnd = ValidateHwnd(hWnd);
|
||||||
|
if (!Wnd)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
DesktopWnd = GetThreadDesktopWnd();
|
||||||
|
|
||||||
|
lpPoint->x += DesktopWnd->rcClient.left - Wnd->rcClient.left;
|
||||||
|
lpPoint->y += DesktopWnd->rcClient.top - Wnd->rcClient.top;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
BOOL WINAPI
|
||||||
|
ClientToScreen(HWND hWnd, LPPOINT lpPoint)
|
||||||
|
{
|
||||||
|
PWND Wnd, DesktopWnd;
|
||||||
|
|
||||||
|
Wnd = ValidateHwnd(hWnd);
|
||||||
|
if (!Wnd)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
DesktopWnd = GetThreadDesktopWnd();
|
||||||
|
|
||||||
|
lpPoint->x += Wnd->rcClient.left - DesktopWnd->rcClient.left;
|
||||||
|
lpPoint->y += Wnd->rcClient.top - DesktopWnd->rcClient.top;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -65,6 +65,7 @@ DtbgWindowProc(HWND Wnd,
|
||||||
return (LRESULT)TRUE;
|
return (LRESULT)TRUE;
|
||||||
|
|
||||||
case WM_CREATE:
|
case WM_CREATE:
|
||||||
|
NtUserSetWindowFNID(Wnd, FNID_DESKTOP); // Anti-ReactOS hack!
|
||||||
case WM_CLOSE:
|
case WM_CLOSE:
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
|
@ -1036,12 +1036,16 @@ NtUserCreateDesktop(
|
||||||
}
|
}
|
||||||
ExFreePoolWithTag(DesktopName.Buffer, TAG_STRING);
|
ExFreePoolWithTag(DesktopName.Buffer, TAG_STRING);
|
||||||
|
|
||||||
|
//// why is this here?
|
||||||
|
#if 0
|
||||||
if (! NT_SUCCESS(Status))
|
if (! NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("Failed to create desktop handle\n");
|
DPRINT1("Failed to create desktop handle\n");
|
||||||
SetLastNtError(Status);
|
SetLastNtError(Status);
|
||||||
RETURN( NULL);
|
RETURN( NULL);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
////
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create a handle for CSRSS and notify CSRSS for Creating Desktop Window.
|
* Create a handle for CSRSS and notify CSRSS for Creating Desktop Window.
|
||||||
|
@ -1072,7 +1076,35 @@ NtUserCreateDesktop(
|
||||||
SetLastNtError(Status);
|
SetLastNtError(Status);
|
||||||
RETURN( NULL);
|
RETURN( NULL);
|
||||||
}
|
}
|
||||||
|
#if 0 // Turn on when server side proc is ready.
|
||||||
|
//
|
||||||
|
// Create desktop window.
|
||||||
|
//
|
||||||
|
ClassName.Buffer = ((PWSTR)((ULONG_PTR)(WORD)(gpsi->atomSysClass[ICLS_DESKTOP])));
|
||||||
|
ClassName.Length = 0;
|
||||||
|
RtlZeroMemory(&MenuName, sizeof(MenuName));
|
||||||
|
RtlZeroMemory(&WindowName, sizeof(WindowName));
|
||||||
|
|
||||||
|
RtlZeroMemory(&Cs, sizeof(Cs));
|
||||||
|
Cs.x = UserGetSystemMetrics(SM_XVIRTUALSCREEN);
|
||||||
|
Cs.y = UserGetSystemMetrics(SM_YVIRTUALSCREEN);
|
||||||
|
Cs.cx = UserGetSystemMetrics(SM_CXVIRTUALSCREEN);
|
||||||
|
Cs.cy = UserGetSystemMetrics(SM_CYVIRTUALSCREEN);
|
||||||
|
Cs.style = WS_POPUP|WS_CLIPCHILDREN;
|
||||||
|
Cs.hInstance = hModClient; // Experimental mode... Move csr stuff to User32. hModuleWin; // Server side winproc!
|
||||||
|
Cs.lpszName = (LPCWSTR) &WindowName;
|
||||||
|
Cs.lpszClass = (LPCWSTR) &ClassName;
|
||||||
|
|
||||||
|
pWndDesktop = co_UserCreateWindowEx(&Cs, &ClassName, &WindowName);
|
||||||
|
if (!pWnd)
|
||||||
|
{
|
||||||
|
DPRINT1("Failed to create Desktop window handle\n");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DesktopObject->pDeskInfo->spwnd = pWndDesktop;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
W32Thread = PsGetCurrentThreadWin32Thread();
|
W32Thread = PsGetCurrentThreadWin32Thread();
|
||||||
|
|
||||||
if (!W32Thread->rpdesk) IntSetThreadDesktop(DesktopObject,FALSE);
|
if (!W32Thread->rpdesk) IntSetThreadDesktop(DesktopObject,FALSE);
|
||||||
|
@ -1089,7 +1121,7 @@ NtUserCreateDesktop(
|
||||||
RtlZeroMemory(&Cs, sizeof(Cs));
|
RtlZeroMemory(&Cs, sizeof(Cs));
|
||||||
Cs.cx = Cs.cy = 100;
|
Cs.cx = Cs.cy = 100;
|
||||||
Cs.style = WS_POPUP|WS_CLIPCHILDREN;
|
Cs.style = WS_POPUP|WS_CLIPCHILDREN;
|
||||||
Cs.hInstance = hModClient;
|
Cs.hInstance = hModClient; // hModuleWin; // Server side winproc! Leave it to Timo to not pass on notes!
|
||||||
Cs.lpszName = (LPCWSTR) &WindowName;
|
Cs.lpszName = (LPCWSTR) &WindowName;
|
||||||
Cs.lpszClass = (LPCWSTR) &ClassName;
|
Cs.lpszClass = (LPCWSTR) &ClassName;
|
||||||
|
|
||||||
|
@ -1103,6 +1135,14 @@ NtUserCreateDesktop(
|
||||||
DesktopObject->spwndMessage = pWnd;
|
DesktopObject->spwndMessage = pWnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Now,,,
|
||||||
|
if !(WinStaObject->Flags & WSF_NOIO) is (not set) for desktop input output mode (see wiki)
|
||||||
|
Create Tooltip. Saved in DesktopObject->spwndTooltip.
|
||||||
|
Tooltip dwExStyle: WS_EX_TOOLWINDOW|WS_EX_TOPMOST
|
||||||
|
hWndParent are spwndMessage. Use hModuleWin for server side winproc!
|
||||||
|
The rest is same as message window.
|
||||||
|
http://msdn.microsoft.com/en-us/library/bb760250(VS.85).aspx
|
||||||
|
*/
|
||||||
RETURN( Desktop);
|
RETURN( Desktop);
|
||||||
|
|
||||||
CLEANUP:
|
CLEANUP:
|
||||||
|
|
|
@ -2130,7 +2130,6 @@ co_UserCreateWindowEx(CREATESTRUCTW* Cs,
|
||||||
}
|
}
|
||||||
Window->rcClient = Window->rcWindow;
|
Window->rcClient = Window->rcWindow;
|
||||||
|
|
||||||
|
|
||||||
/* Link the window*/
|
/* Link the window*/
|
||||||
if (NULL != ParentWindow)
|
if (NULL != ParentWindow)
|
||||||
{
|
{
|
||||||
|
@ -3886,8 +3885,8 @@ NtUserSetWindowFNID(HWND hWnd,
|
||||||
|
|
||||||
// From user land we only set these.
|
// From user land we only set these.
|
||||||
if (fnID != FNID_DESTROY)
|
if (fnID != FNID_DESTROY)
|
||||||
{
|
{ // Hacked so we can mark desktop~!
|
||||||
if ( ((fnID < FNID_BUTTON) && (fnID > FNID_GHOST)) ||
|
if ( (/*(fnID < FNID_BUTTON)*/ (fnID < FNID_FIRST) && (fnID > FNID_GHOST)) ||
|
||||||
Wnd->fnid != 0 )
|
Wnd->fnid != 0 )
|
||||||
{
|
{
|
||||||
EngSetLastError(ERROR_INVALID_PARAMETER);
|
EngSetLastError(ERROR_INVALID_PARAMETER);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue