Re: Fensterleiste
20.10.2002 16:07:45
Erich
Hallo Franky,hab ich in einem Forum gefunden:
Sub ButtonSchutz()
Call RemoveControlMenuExcel32
End Sub
Sub ButtonEntschützen()
Call RestoreControlMenuExcel32 '3 Button
End Sub
Sub RemoveControlMenuExcel32()
Dim WindowStyle As Long
Dim hwnd As Long
Dim WindowName As String
Dim result
On Error Resume Next
WindowName = Application.Caption
hwnd = FindWindowA(0&, WindowName)
WindowStyle = GetWindowLongA(hwnd, GWL_STYLE)
WindowStyle = WindowStyle And (Not WS_SYSMENU)
result = SetWindowLongA(hwnd, GWL_STYLE, WindowStyle)
End Sub
Sub RestoreControlMenuExcel32()
Dim WindowStyle As Long
Dim hwnd As Long
Dim WindowName As String
Dim result
On Error Resume Next
WindowName = Application.Caption
hwnd = FindWindowA(0&, ByVal WindowName)
WindowStyle = GetWindowLongA(hwnd, GWL_STYLE)
WindowStyle = WindowStyle Or WS_SYSMENU
result = SetWindowLongA(hwnd, GWL_STYLE, WindowStyle)
End Sub
Allerdings weiß ich nicht, ob damit nicht noch mehr verbunden ist.
mfg