Re: [1/2] user32: fix FindWindowEx behavior if window name is an empty charachter

2010-10-05 Thread Dmitry Timoshkov
Louis Lenders  wrote:

> >It would be better to avoid duplicate GetWindowTextW() calls.
> 
> I thought a long time how to fix this, but i couldn't find another way than
> this one, because we need to find out whether or not the window title is
> empty, and afaik we can only do that by calling GetWindowText (again). If
> you have another way that i overlooked, please let me know

I sent 2 patches that make your FindWindow() tests pass under Wine. Did you
run the tests after your fix? They don't pass without patching explorer. Also
your test has a typo in the comment, and probably the tests need to go into
their own test function, and not hijack the message window tests.

-- 
Dmitry.




Re: [1/2] user32: fix FindWindowEx behavior if window name is an empty charachter

2010-10-05 Thread Ricardo Filipe
2010/10/5 Louis Lenders :
>>It would be better to avoid duplicate GetWindowTextW() calls.
>
> I thought a long time how to fix this, but i couldn't find another way than 
> this one, because we need to find out whether or not the window title is 
> empty, and afaik we can only do that by calling GetWindowText (again). If you 
> have another way that i overlooked, please let me know
>
> Regards Louis
>
>
>
>
>
>

doesn't it work if you store the GetWindowText result in a variable
and check that variable in the condition? or you need the two calls to
have the right behaviour (seems unlikely...)?




Re: [1/2] user32: fix FindWindowEx behavior if window name is an empty charachter

2010-10-04 Thread Dmitry Timoshkov
Louis Lenders  wrote:

> @@ -1756,6 +1756,10 @@ HWND WINAPI FindWindowExW( HWND parent, HWND child, 
> LPCWSTR className, LPCWSTR t
>  {
>  while (list[i])
>  {
> +/* Handle special case where empty title bar or no title bar 
> exists, so GetWindowsText would return NULL
> +   but if title is also an empty char we still have a match */ 
> +if (!GetWindowTextW( list[i], buffer, len + 1 ) && !title[0]) 
> break;
> +
>  if (GetWindowTextW( list[i], buffer, len + 1 ) && !strcmpiW( 
> buffer, title )) break;
>  i++;
>  }

It would be better to avoid duplicate GetWindowTextW() calls.

-- 
Dmitry.