Ignore:
Timestamp:
Jul 8, 2002, 1:43:44 PM (23 years ago)
Author:
sandervl
Message:

do not set focus to child dialog controls

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/win32dlg.cpp

    r8797 r8849  
    1 /* $Id: win32dlg.cpp,v 1.77 2002-06-28 12:38:00 sandervl Exp $ */
     1/* $Id: win32dlg.cpp,v 1.78 2002-07-08 11:43:44 sandervl Exp $ */
    22/*
    33 * Win32 Dialog Code for OS/2
     
    265265        if(SendMessageA(getWindowHandle(), WM_INITDIALOG, (WPARAM)hwndFocus, param))
    266266        {
    267             /* check where the focus is again,
    268              * some controls status might have changed in WM_INITDIALOG */
    269             hwndFocus = GetNextDlgTabItem( getWindowHandle(), 0, FALSE );
    270             if(hwndFocus) {
    271                 SetFocus(hwndFocus);
     267            //SvL: Experiments in NT4 show that dialogs that are children don't
     268            //     receive focus. Not sure if this is always true. (couldn't
     269            //     find any remarks about this in the SDK docs)
     270            if(!(getStyle() & WS_CHILD))
     271            {
     272                /* check where the focus is again,
     273                 * some controls status might have changed in WM_INITDIALOG */
     274                hwndFocus = GetNextDlgTabItem( getWindowHandle(), 0, FALSE );
     275                if(hwndFocus) {
     276                    SetFocus(hwndFocus);
     277                }
    272278            }
    273279        }
    274280        else
    275281        {
    276             /* If the dlgproc has returned FALSE (indicating handling of keyboard focus)
    277                but the focus has not changed, set the focus where we expect it. */
    278             if ( (getStyle() & WS_VISIBLE) && ( GetFocus() == hwndPreInitFocus ) )
     282            //SvL: Experiments in NT4 show that dialogs that are children don't
     283            //     receive focus. Not sure if this is always true. (couldn't
     284            //     find any remarks about this in the SDK docs)
     285            if(!(getStyle() & WS_CHILD))
    279286            {
    280                 hwndFocus = GetNextDlgTabItem( getWindowHandle(), 0, FALSE);
    281                 if( hwndFocus )
     287                /* If the dlgproc has returned FALSE (indicating handling of keyboard focus)
     288                   but the focus has not changed, set the focus where we expect it. */
     289                if ( (getStyle() & WS_VISIBLE) && ( GetFocus() == hwndPreInitFocus ) )
    282290                    SetFocus( hwndFocus );
    283291            }
Note: See TracChangeset for help on using the changeset viewer.