Re: [user32][msgbox] Disable IDCANCEL for some MessageBoxs
"Anatoly Lyutin" <vostok(a)etersoft.ru> wrote:
@@ -129,9 +132,11 @@ static HFONT MSGBOX_OnInit(HWND hwnd, LP ShowWindow(GetDlgItem(hwnd, IDCANCEL), SW_HIDE); ShowWindow(GetDlgItem(hwnd, IDYES), SW_HIDE); ShowWindow(GetDlgItem(hwnd, IDNO), SW_HIDE); + bUseCancel = FALSE; break; case MB_YESNO: ShowWindow(GetDlgItem(hwnd, IDCANCEL), SW_HIDE); + bUseCancel = FALSE;
It would be much simpler to use IsWindowVisible(GetDlgItem(hwnd, IDCANCEL)) where appropriate instead of introducing bUseCancel.
/* fall through */ case MB_YESNOCANCEL: ShowWindow(GetDlgItem(hwnd, IDOK), SW_HIDE); @@ -147,6 +152,11 @@ static HFONT MSGBOX_OnInit(HWND hwnd, LP ShowWindow(GetDlgItem(hwnd, IDNO), SW_HIDE); break; } + if(!bUseCancel) + { + SetWindowLongW(hwnd,GWL_STYLE,GetWindowLongW(hwnd,GWL_STYLE)&~(WS_SYSMENU)); + } + SetPropA(hwnd, "WINE_MSGBOX_BUSECANCEL", (HANDLE)bUseCancel);
What is the purpose of removing WS_SYSMENU? In any case this change requires a test case. -- Dmitry.
participants (1)
-
Dmitry Timoshkov