Make DM_SETDEFID message work for owner drawn buttons as well.
This commit is contained in:
parent
f3b01aa790
commit
f57112a9f8
|
@ -119,8 +119,10 @@ static HWND DEFDLG_FindDefButton( HWND hwndDlg )
|
|||
static BOOL DEFDLG_SetDefButton( HWND hwndDlg, DIALOGINFO *dlgInfo,
|
||||
HWND hwndNew )
|
||||
{
|
||||
DWORD dlgcode;
|
||||
if (hwndNew &&
|
||||
!(SendMessageW(hwndNew, WM_GETDLGCODE, 0, 0 ) & DLGC_UNDEFPUSHBUTTON))
|
||||
!((dlgcode=SendMessageW(hwndNew, WM_GETDLGCODE, 0, 0 ))
|
||||
& (DLGC_UNDEFPUSHBUTTON | DLGC_BUTTON)))
|
||||
return FALSE; /* Destination is not a push button */
|
||||
|
||||
if (dlgInfo->idResult) /* There's already a default pushbutton */
|
||||
|
@ -131,6 +133,7 @@ static BOOL DEFDLG_SetDefButton( HWND hwndDlg, DIALOGINFO *dlgInfo,
|
|||
}
|
||||
if (hwndNew)
|
||||
{
|
||||
if(dlgcode==DLGC_UNDEFPUSHBUTTON)
|
||||
SendMessageA( hwndNew, BM_SETSTYLE, BS_DEFPUSHBUTTON, TRUE );
|
||||
dlgInfo->idResult = GetDlgCtrlID( hwndNew );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue