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
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.