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 ) ...@@ -119,8 +119,10 @@ static HWND DEFDLG_FindDefButton( HWND hwndDlg )
static BOOL DEFDLG_SetDefButton( HWND hwndDlg, DIALOGINFO *dlgInfo, static BOOL DEFDLG_SetDefButton( HWND hwndDlg, DIALOGINFO *dlgInfo,
HWND hwndNew ) HWND hwndNew )
{ {
DWORD dlgcode;
if (hwndNew && 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 */ return FALSE; /* Destination is not a push button */
if (dlgInfo->idResult) /* There's already a default pushbutton */ if (dlgInfo->idResult) /* There's already a default pushbutton */
...@@ -131,6 +133,7 @@ static BOOL DEFDLG_SetDefButton( HWND hwndDlg, DIALOGINFO *dlgInfo, ...@@ -131,6 +133,7 @@ static BOOL DEFDLG_SetDefButton( HWND hwndDlg, DIALOGINFO *dlgInfo,
} }
if (hwndNew) if (hwndNew)
{ {
if(dlgcode==DLGC_UNDEFPUSHBUTTON)
SendMessageA( hwndNew, BM_SETSTYLE, BS_DEFPUSHBUTTON, TRUE ); SendMessageA( hwndNew, BM_SETSTYLE, BS_DEFPUSHBUTTON, TRUE );
dlgInfo->idResult = GetDlgCtrlID( hwndNew ); dlgInfo->idResult = GetDlgCtrlID( hwndNew );
} }
......
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