Commit 4f15239c authored by Alexandre Julliard's avatar Alexandre Julliard Committed by Alexandre Julliard

ATOMs are considered unique, so we don't need to check class

pointers in FindWindow.
parent ed5ac5f6
...@@ -1494,7 +1494,6 @@ static HWND WIN_FindWindow( HWND parent, HWND child, ATOM className, ...@@ -1494,7 +1494,6 @@ static HWND WIN_FindWindow( HWND parent, HWND child, ATOM className,
{ {
WND *pWnd; WND *pWnd;
HWND retvalue; HWND retvalue;
CLASS *pClass = NULL;
if (child) if (child)
{ {
...@@ -1529,30 +1528,9 @@ static HWND WIN_FindWindow( HWND parent, HWND child, ATOM className, ...@@ -1529,30 +1528,9 @@ static HWND WIN_FindWindow( HWND parent, HWND child, ATOM className,
goto end; goto end;
} }
/* For a child window, all siblings will have the same hInstance, */
/* so we can look for the class once and for all. */
if (className && (pWnd->dwStyle & WS_CHILD))
{
if (!(pClass = CLASS_FindClassByAtom( className, pWnd->hInstance )))
{
retvalue = 0;
goto end;
}
}
for ( ; pWnd ; WIN_UpdateWndPtr(&pWnd,pWnd->next)) for ( ; pWnd ; WIN_UpdateWndPtr(&pWnd,pWnd->next))
{ {
if (className && !(pWnd->dwStyle & WS_CHILD)) if (className && (pWnd->class->atomName != className))
{
if (!((pClass = CLASS_FindClassByAtom( className, pWnd->hInstance))
||(pClass = CLASS_FindClassByAtom( className, GetExePtr(pWnd->hInstance))))
)
continue; /* Skip this window */
}
if (pClass && (pWnd->class != pClass))
continue; /* Not the right class */ continue; /* Not the right class */
/* Now check the title */ /* Now check the title */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment