Changeset 8968


Ignore:
Timestamp:
Aug 8, 2002, 2:34:37 PM (23 years ago)
Author:
sandervl
Message:

PF: Fix for handling VK_RETURN in dialogs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/src/user32/windlgmsg.cpp

    r8812 r8968  
    1 /* $Id: windlgmsg.cpp,v 1.15 2002-07-01 11:33:09 sandervl Exp $ */
     1/* $Id: windlgmsg.cpp,v 1.16 2002-08-08 12:34:37 sandervl Exp $ */
    22/*
    33 * Win32 dialog message APIs for OS/2
     
    276276                if (HIWORD(dw) == DC_HASDEFID)
    277277                {
    278                   //@PF If DEFID button is disabled do not press it!   
    279278                  if (IsWindowEnabled(GetDlgItem(hwndDlg, LOWORD(dw))))
     279                  {
    280280                       SendMessageA( hwndDlg, WM_COMMAND,
    281281                                     MAKEWPARAM( LOWORD(dw), BN_CLICKED ),
    282282                                    (LPARAM)GetDlgItem(hwndDlg, LOWORD(dw)));
     283                  }
    283284                }
    284285                else
    285286                {
    286                     SendMessageA( hwndDlg, WM_COMMAND, IDOK,
     287                    // @@PF Win2k here behaves this way: checks focus and then
     288                    // if it is button clicks it, I also added enabled check
     289                    HWND hwndCtrl = GetFocus();
     290                    if (SendMessageA(hwndCtrl, WM_GETDLGCODE, 0, 0) & DLGC_UNDEFPUSHBUTTON)
     291                    {
     292                       if (IsWindowEnabled(hwndCtrl))
     293                         SendMessageA( hwndDlg, WM_COMMAND,
     294                                       MAKEWPARAM( GetDlgCtrlID(hwndCtrl), BN_CLICKED ),
     295                                       (LPARAM)hwndCtrl);
     296                    }
     297                    else
     298                       SendMessageA( hwndDlg, WM_COMMAND, IDOK,
    287299                                    (LPARAM)GetDlgItem( hwndDlg, IDOK ) );
    288 
    289300                }
    290301
Note: See TracChangeset for help on using the changeset viewer.