M
Marvin Hlavac
Is it at all possible to force a workbook window to be of certain size at
all times and don't let the user make it smaller?
all times and don't let the user make it smaller?
Private Declare Function GetSystemMenu Lib "user32" _
(ByVal hWnd As Long, ByVal bRevert As Long) As Long
Private Declare Function DeleteMenu Lib "user32" _
(ByVal hMenu As Long, ByVal nPosition As Long, _
ByVal wFlags As Long) As Long
Private Declare Function FindWindowA Lib "user32" _
(ByVal lpClassName As String, ByVal lpWindowName _
As String) As Long
Public Sub DisableSystemMenu()
Dim lHandle As Long
On Error Resume Next
lHandle = FindWindowA(vbNullString, Application.Caption)
If lHandle <> 0 Then
DeleteMenu GetSystemMenu(lHandle, False), 0, 1024
DeleteMenu GetSystemMenu(lHandle, False), 1, 1024
DeleteMenu GetSystemMenu(lHandle, False), 1, 1024
DeleteMenu GetSystemMenu(lHandle, False), 1, 1024
End If
End Sub
Public Sub EnableSystemMenu()
Dim lHandle As Long
On Error Resume Next
lHandle = FindWindowA(vbNullString, Application.Caption)
GetSystemMenu lHandle, True
End Sub