Add support for CS_NOCLOSE

Dmitry Timoshkov dmitry at baikal.ru
Thu Aug 7 05:35:13 CDT 2003


"Alexandre Julliard" <julliard at winehq.org> wrote:

> This is implemented already in MENU_InitSysMenuPopup; if it doesn't
> work right it should be fixed there.

Windows doesn't use SetWindowPos to update the disabled Close button,
but draws the button directly. So you can apply the patch and ignore
only the last chunk of it:

--- cvs/hq/wine/windows/win.c Wed Jun 25 15:59:24 2003
+++ wine/windows/win.c Sat Aug  2 22:43:41 2003
@@ -1169,6 +1169,10 @@ static HWND WIN_CreateWindowEx( CREATEST
         return 0;
     }
 
+    /* Disable the 'Close' system menu item in the case of CS_NOCLOSE */
+    if ((GetWindowLongW(hwnd, GWL_STYLE) & WS_SYSMENU) && (GetClassLongW(hwnd, GCL_STYLE) & CS_NOCLOSE))
+        EnableMenuItem(GetSystemMenu(hwnd, FALSE), SC_CLOSE, MF_GRAYED);
+
     /* Notify the parent window only */
 
     send_parent_notify( hwnd, WM_CREATE );

I'll try to investigate why existing code in MENU_InitSysMenuPopup doesn't work.

-- 
Dmitry.





More information about the wine-devel mailing list