[user32][msgbox] Disable IDCANCEL for some MessageBoxs

Dmitry Timoshkov dmitry at codeweavers.com
Fri Dec 29 23:15:39 CST 2006


"Anatoly Lyutin" <vostok at 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.



More information about the wine-devel mailing list