When searching for the DEFPUSHBUTTON in a dialog, recurse into child

windows with the WS_EX_CONTROLPARENT style (if they are visible and
enabled).
This commit is contained in:
Zach Gorman 2004-08-19 01:03:12 +00:00 committed by Alexandre Julliard
parent 2141f28fa0
commit 3944cb3b68
1 changed files with 12 additions and 1 deletions

View File

@ -115,11 +115,22 @@ static void DEFDLG_RestoreFocus( HWND hwnd )
*/
static HWND DEFDLG_FindDefButton( HWND hwndDlg )
{
HWND hwndChild = GetWindow( hwndDlg, GW_CHILD );
HWND hwndChild, hwndTmp;
hwndChild = GetWindow( hwndDlg, GW_CHILD );
while (hwndChild)
{
if (SendMessageW( hwndChild, WM_GETDLGCODE, 0, 0 ) & DLGC_DEFPUSHBUTTON)
break;
/* Recurse into WS_EX_CONTROLPARENT controls */
if (GetWindowLongA( hwndChild, GWL_EXSTYLE ) & WS_EX_CONTROLPARENT)
{
LONG dsStyle = GetWindowLongA( hwndChild, GWL_STYLE );
if ((dsStyle & WS_VISIBLE) && !(dsStyle & WS_DISABLED) &&
(hwndTmp = DEFDLG_FindDefButton(hwndChild)) != NULL)
return hwndTmp;
}
hwndChild = GetWindow( hwndChild, GW_HWNDNEXT );
}
return hwndChild;