Add support for CS_NOCLOSE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

Changelog:
    Dmitry Timoshkov <dmitry@codeweavers.com>
    Add support for CS_NOCLOSE.

diff -u cvs/hq/wine/controls/menu.c wine/controls/menu.c
--- cvs/hq/wine/controls/menu.c	Tue May 13 09:33:13 2003
+++ wine/controls/menu.c	Sat Aug  2 22:43:41 2003
@@ -3262,14 +3262,16 @@ UINT WINAPI EnableMenuItem( HMENU hMenu,
 	    if (menu->hSysMenuOwner != 0)
 	    {
 		POPUPMENU* parentMenu;
+                HDC hdc;
 
 		/* Get the parent menu to access*/
 		if (!(parentMenu = MENU_GetMenu(menu->hSysMenuOwner)))
 		    return (UINT)-1;
 
 		/* Refresh the frame to reflect the change*/
-		SetWindowPos(parentMenu->hWnd, 0, 0, 0, 0, 0,
-			     SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER);
+                hdc = GetWindowDC(parentMenu->hWnd);
+                NC_DrawCloseButton95(parentMenu->hWnd, hdc, FALSE, item->fState & MF_GRAYED);
+                ReleaseDC(parentMenu->hWnd, hdc);
 	    }
 	}
 
diff -u cvs/hq/wine/include/nonclient.h wine/include/nonclient.h
--- cvs/hq/wine/include/nonclient.h	Tue Mar 12 13:38:48 2002
+++ wine/include/nonclient.h	Sat Aug  2 22:43:41 2003
@@ -31,6 +31,7 @@ extern LONG NC_HandleNCLButtonDown( HWND
 extern LONG NC_HandleNCLButtonDblClk( HWND hwnd, WPARAM wParam, LPARAM lParam);
 extern LONG NC_HandleSysCommand( HWND hwnd, WPARAM wParam, LPARAM lParam );
 extern LONG NC_HandleSetCursor( HWND hwnd, WPARAM wParam, LPARAM lParam );
+extern void NC_DrawCloseButton95( HWND hwnd, HDC hdc, BOOL down, BOOL bGrayed );
 extern void NC_DrawSysButton( HWND hwnd, HDC hdc, BOOL down );
 extern BOOL NC_DrawSysButton95( HWND hwnd, HDC hdc, BOOL down );
 extern void NC_GetSysPopupPos( HWND hwnd, RECT* rect );
diff -u cvs/hq/wine/windows/nonclient.c wine/windows/nonclient.c
--- cvs/hq/wine/windows/nonclient.c	Wed Feb 19 21:30:36 2003
+++ wine/windows/nonclient.c	Sat Aug  2 22:43:41 2003
@@ -974,7 +974,7 @@ NC_DrawSysButton95 (HWND hwnd, HDC hdc, 
  *
  *****************************************************************************/
 
-static void NC_DrawCloseButton95 (HWND hwnd, HDC hdc, BOOL down, BOOL bGrayed)
+void NC_DrawCloseButton95 (HWND hwnd, HDC hdc, BOOL down, BOOL bGrayed)
 {
     RECT rect;
 
@@ -1352,7 +1352,7 @@ static void  NC_DrawCaption95(
 
 	/* Draw a grayed close button if disabled and a normal one if SC_CLOSE is not there */
 	NC_DrawCloseButton95 (hwnd, hdc, FALSE,
-			      ((((state & MF_DISABLED) || (state & MF_GRAYED))) && (state != 0xFFFFFFFF)));
+                              (state & (MF_DISABLED | MF_GRAYED)) && (state != 0xFFFFFFFF));
 	r.right -= GetSystemMetrics(SM_CYCAPTION) - 1;
 
 	if ((style & WS_MAXIMIZEBOX) || (style & WS_MINIMIZEBOX))
diff -u cvs/hq/wine/windows/win.c wine/windows/win.c
--- 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 );





[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux