mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 17:44:45 +00:00
Implemented FindWindowEx, it's untested, but the code should work, as it's fairly straightfoward...This is only a partial implementation however. It searches all windows regardless...
svn path=/trunk/; revision=4894
This commit is contained in:
parent
57a3b7cc34
commit
53bf611e09
3 changed files with 35 additions and 15 deletions
|
@ -504,8 +504,8 @@ STDCALL
|
||||||
NtUserFindWindowEx(
|
NtUserFindWindowEx(
|
||||||
HWND hwndParent,
|
HWND hwndParent,
|
||||||
HWND hwndChildAfter,
|
HWND hwndChildAfter,
|
||||||
LPCWSTR ucClassName,
|
PUNICODE_STRING ucClassName,
|
||||||
LPCWSTR ucWindowName
|
PUNICODE_STRING ucWindowName
|
||||||
);
|
);
|
||||||
|
|
||||||
DWORD
|
DWORD
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: window.c,v 1.37 2003/06/14 10:00:58 gvg Exp $
|
/* $Id: window.c,v 1.38 2003/06/15 04:25:34 rcampbell Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS user32.dll
|
* PROJECT: ReactOS user32.dll
|
||||||
|
@ -714,7 +714,29 @@ FindWindowExW(HWND hwndParent,
|
||||||
LPCWSTR lpszClass,
|
LPCWSTR lpszClass,
|
||||||
LPCWSTR lpszWindow)
|
LPCWSTR lpszWindow)
|
||||||
{
|
{
|
||||||
return NtUserFindWindowEx(hwndParent, hwndChildAfter, lpszClass, lpszWindow);
|
PUNICODE_STRING ucClassName;
|
||||||
|
PUNICODE_STRING ucWindowName;
|
||||||
|
|
||||||
|
if (IS_ATOM(lpszClass))
|
||||||
|
{
|
||||||
|
RtlInitUnicodeString(ucClassName, NULL);
|
||||||
|
ucClassName->Buffer = (LPWSTR)lpszClass;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RtlInitUnicodeString(ucClassName, lpszClass);
|
||||||
|
}
|
||||||
|
if (IS_ATOM(lpszWindow))
|
||||||
|
{
|
||||||
|
RtlInitUnicodeString(ucWindowName, NULL);
|
||||||
|
ucClassName->Buffer = (LPWSTR)lpszWindow;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RtlInitUnicodeString(ucWindowName, lpszWindow);
|
||||||
|
}
|
||||||
|
|
||||||
|
return NtUserFindWindowEx(hwndParent, hwndChildAfter, ucClassName, ucWindowName);
|
||||||
}
|
}
|
||||||
|
|
||||||
WINBOOL STDCALL
|
WINBOOL STDCALL
|
||||||
|
|
|
@ -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.54 2003/06/14 10:00:57 gvg Exp $
|
/* $Id: window.c,v 1.55 2003/06/15 04:25:34 rcampbell Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -1139,10 +1139,9 @@ NtUserFillWindow(DWORD Unknown0,
|
||||||
HWND STDCALL
|
HWND STDCALL
|
||||||
NtUserFindWindowEx(HWND hwndParent,
|
NtUserFindWindowEx(HWND hwndParent,
|
||||||
HWND hwndChildAfter,
|
HWND hwndChildAfter,
|
||||||
LPCWSTR ucClassName,
|
PUNICODE_STRING ucClassName,
|
||||||
LPCWSTR ucWindowName)
|
PUNICODE_STRING ucWindowName)
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
HWND windowHandle;
|
HWND windowHandle;
|
||||||
PWINDOW_OBJECT windowObject;
|
PWINDOW_OBJECT windowObject;
|
||||||
|
@ -1157,9 +1156,9 @@ NtUserFindWindowEx(HWND hwndParent,
|
||||||
return (HWND)0;
|
return (HWND)0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ExAcquireFastMutexUnsafe (&PsGetWin32Process()->WindowListLock);
|
//ExAcquireFastMutexUnsafe (&PsGetWin32Process()->WindowListLock);
|
||||||
currentEntry = PsGetWin32Process()->WindowListHead.Flink;
|
currentEntry = W32kGetActiveDesktop()->WindowListHead.Flink;
|
||||||
while (currentEntry != &PsGetWin32Process()->WindowListHead)
|
while (currentEntry != &W32kGetActiveDesktop()->WindowListHead)
|
||||||
{
|
{
|
||||||
windowObject = CONTAINING_RECORD (currentEntry, WINDOW_OBJECT,
|
windowObject = CONTAINING_RECORD (currentEntry, WINDOW_OBJECT,
|
||||||
ListEntry);
|
ListEntry);
|
||||||
|
@ -1168,20 +1167,19 @@ NtUserFindWindowEx(HWND hwndParent,
|
||||||
RtlCompareUnicodeString (ucWindowName, &windowObject->WindowName,
|
RtlCompareUnicodeString (ucWindowName, &windowObject->WindowName,
|
||||||
TRUE) == 0)
|
TRUE) == 0)
|
||||||
{
|
{
|
||||||
ObmCreateHandle(PsGetWin32Process()->HandleTable,
|
ObmCreateHandle(W32kGetActiveDesktop()->WindowStation->HandleTable,
|
||||||
windowObject,
|
windowObject,
|
||||||
&windowHandle);
|
&windowHandle);
|
||||||
ExReleaseFastMutexUnsafe (&PsGetWin32Process()->WindowListLock);
|
//ExReleaseFastMutexUnsafe (&PsGetWin32Process()->WindowListLock);
|
||||||
ObmDereferenceObject (classObject);
|
ObmDereferenceObject (classObject);
|
||||||
|
|
||||||
return windowHandle;
|
return windowHandle;
|
||||||
}
|
}
|
||||||
currentEntry = currentEntry->Flink;
|
currentEntry = currentEntry->Flink;
|
||||||
}
|
}
|
||||||
ExReleaseFastMutexUnsafe (&PsGetWin32Process()->WindowListLock);
|
//ExReleaseFastMutexUnsafe (&PsGetWin32Process()->WindowListLock);
|
||||||
|
|
||||||
ObmDereferenceObject (classObject);
|
ObmDereferenceObject (classObject);
|
||||||
#endif
|
|
||||||
|
|
||||||
return (HWND)0;
|
return (HWND)0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue