Commit f57112a9 authored by Rein Klazes's avatar Rein Klazes Committed by Alexandre Julliard

Make DM_SETDEFID message work for owner drawn buttons as well.

parent f3b01aa7
......@@ -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,7 +133,8 @@ static BOOL DEFDLG_SetDefButton( HWND hwndDlg, DIALOGINFO *dlgInfo,
}
if (hwndNew)
{
SendMessageA( hwndNew, BM_SETSTYLE, BS_DEFPUSHBUTTON, TRUE );
if(dlgcode==DLGC_UNDEFPUSHBUTTON)
SendMessageA( hwndNew, BM_SETSTYLE, BS_DEFPUSHBUTTON, TRUE );
dlgInfo->idResult = GetDlgCtrlID( hwndNew );
}
else dlgInfo->idResult = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment