user32:msg: Test for SetFocus

Anatoly Lyutin vostok at etersoft.ru
Thu Jun 19 06:02:36 CDT 2008


Dmitry Timoshkov wrote:
> Looks like you need a test for window activation, not focus or hooks.
> You may try to add some missing bits to win.c,test_SetActiveWindow().
May be.. I decide to test SetFocus() because in this function calls 
set_active_window() and another case set_active_window() not calls. I 
try to understand how SetFocus() works..
>
> Are you trying to fix a bug?
>
No. I have written in the first letter with test: I try to make
"test_ShowWindow : "/* 32 */ { SW_HIDE, TRUE, 0, WmHide_3, TRUE },

 passes clear. And I found that it falls because HCBT_SETFOCUS not set 
for this window after  WM_WINDOWPOSCHANGING and if I put a 
SetFocus(hwnd) in static BOOL show_window( HWND hwnd, INT cmd )
{
...
if (cmd == SW_HIDE)
    {
...
          /* Revert focus to parent */
        hFocus = GetFocus();
        if (hwnd == hFocus || IsChild(hwnd, hFocus))
        {
            HWND parent = GetAncestor(hwnd, GA_PARENT);
            if (parent == GetDesktopWindow()) parent = 0;
            SetFocus(parent);
        }

       to this -> SetFocus(hwnd); // naturally this is a very bad hack, 
but I only search working of show_window()
       or
       SetFocus(GetAncestor(hwnd, GA_ROOT));
        this hook will be set and broke working of another test, but in 
another cases such us :
       SetFocus( GetAncestor(hwnd, GA_PARENT));
        or
       SetFocus(0);
       this hook not set. // nothing to strange of cause..

..
}

I try to catch issue why in another test hook sets well and why in this 
test hook is not sets.

-- 
Best regards
	Anatoly Lyutin.




More information about the wine-devel mailing list