Vielen Dank im vorraus
Frank
Vielen Dank im vorraus
Frank
'In ein Modulgruß HerbertOption Explicit
Public Const GWL_STYLE = (-16)
Public Const WS_SYSMENU = &H80000Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Declare Function DrawMenuBar Lib "user32" (ByVal hWnd As Long) As LongSub Hide_SYSMENU()
Dim xl_hwnd, lStyle
xl_hwnd = FindWindow("xlmain", vbNullString)
If xl_hwnd <> 0 Then
lStyle = GetWindowLong(xl_hwnd, GWL_STYLE)
lStyle = SetWindowLong(xl_hwnd, GWL_STYLE, lStyle And Not WS_SYSMENU)
DrawMenuBar xl_hwnd
End If
End SubSub Show_SYSMENU()
Dim xl_hwnd, lStyle
xl_hwnd = FindWindow("xlmain", vbNullString)
If xl_hwnd <> 0 Then
lStyle = GetWindowLong(xl_hwnd, GWL_STYLE)
lStyle = SetWindowLong(xl_hwnd, GWL_STYLE, lStyle Or WS_SYSMENU)
DrawMenuBar xl_hwnd
End If
End Sub'In "Diese Arbeitsmappe"
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.OnKey "%{F4}"
Call Show_SYSMENU
End SubPrivate Sub Workbook_Open()
Application.OnKey "%{F4}", ""
Call Hide_SYSMENU
End Sub