Added WindowFromDC() by Philip Alldredge

svn path=/trunk/; revision=5612
This commit is contained in:
Thomas Bluemel 2003-08-17 09:17:04 +00:00
parent f8e97c4994
commit e283c5b7d3
5 changed files with 25 additions and 6 deletions

View file

@ -163,6 +163,7 @@ NtUserCallNoParam(
#define ONEPARAM_ROUTINE_GETMENU 0x01
#define ONEPARAM_ROUTINE_ISWINDOWUNICODE 0x02
#define ONEPARAM_ROUTINE_WINDOWFROMDC 0x03
DWORD
STDCALL
NtUserCallOneParam(

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: dc.c,v 1.12 2003/07/10 21:04:31 chorns Exp $
/* $Id: dc.c,v 1.13 2003/08/17 09:17:04 weiden Exp $
*
* PROJECT: ReactOS user32.dll
* FILE: lib/user32/windows/input.c
@ -87,13 +87,12 @@ ReleaseDC(
/*
* @unimplemented
* @implemented
*/
HWND
STDCALL
WindowFromDC(
HDC hDC)
{
UNIMPLEMENTED;
return (HWND)0;
return (HWND)NtUserCallOneParam((DWORD)hDC, ONEPARAM_ROUTINE_WINDOWFROMDC);
}

View file

@ -47,5 +47,6 @@ HRGN STDCALL DceGetVisRgn(HWND hWnd, ULONG Flags, HWND hWndChild, ULONG CFlags)
INT FASTCALL DCE_ExcludeRgn(HDC, HWND, HRGN);
BOOL FASTCALL DCE_InvalidateDCE(HWND, const PRECTL);
BOOL FASTCALL DCE_InternalDelete(PDCE dce);
HWND FASTCALL W32kWindowFromDC(HDC hDc);
#endif

View file

@ -1,4 +1,4 @@
/* $Id: misc.c,v 1.4 2003/08/11 21:10:49 royce Exp $
/* $Id: misc.c,v 1.5 2003/08/17 09:17:04 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -13,6 +13,7 @@
#include <include/error.h>
#include <include/window.h>
#include <include/painting.h>
#include <include/dce.h>
#define NDEBUG
#include <debug.h>
@ -69,6 +70,9 @@ NtUserCallOneParam(
W32kReleaseWindowObject(WindowObject);
return Result;
case ONEPARAM_ROUTINE_WINDOWFROMDC:
return (DWORD)W32kWindowFromDC((HDC)Param);
}
DPRINT1("Calling invalid routine number 0x%x in NtUserCallOneParam()\n Param=0x%x\n",
Routine, Param);

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: windc.c,v 1.19 2003/08/11 19:05:26 gdalsnes Exp $
/* $Id: windc.c,v 1.20 2003/08/17 09:17:04 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -468,5 +468,19 @@ DCE_InternalDelete(PDCE Dce)
return NULL != PrevInList;
}
HWND FASTCALL
W32kWindowFromDC(HDC hDc)
{
DCE *Dce;
for (Dce = FirstDce; Dce != NULL; Dce = Dce->next)
{
if(Dce->hDC == hDc)
{
return Dce->hwndCurrent;
}
}
return 0;
}
/* EOF */