Private Declare Function GetSystemMenu Lib "user32" _
(ByVal hwnd As Long, _
ByVal bRevert As Long) As Long
Private Declare Function GetWindowLong Lib "user32" _
Alias "GetWindowLongA" _
(ByVal hwnd As Long, _
ByVal nIndex As Long) As Long
Private Declare Function RemoveMenu Lib "user32" _
(ByVal hMenu As Long, _
ByVal nPosition As Long, _
ByVal wFlags As Long) As Long
Private Declare Function SetWindowLong Lib "user32" _
Alias "SetWindowLongA" _
(ByVal hwnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long
Private Sub SetForm()
Dim hSysMenu As Long, R As Long, J As Long
Dim dw As Long, rr As Long, i As Integer
Const MF_BYPOSITION = &H400
Const GWL_STYLE = (-16)
hSysMenu = GetSystemMenu(Me.hwnd, 0) RemoveMenu hSysMenu, 5, MF_BYPOSITION '去掉分隔线
RemoveMenu hSysMenu, 4, MF_BYPOSITION '去掉最大化
RemoveMenu(hSysMenu, 2, MF_BYPOSITION '去掉大小 dw = GetWindowLong(Me.hwnd, GWL_STYLE) ' 获得窗口的样式。
dw = dw And &HFFFEFFFF
rr = SetWindowLong(Me.hwnd, GWL_STYLE, dw)
End Sub
在MDIForm_load 中加入代码:
SetFrom然后窗体就不能改变到最大化和调整大小了,只能关闭和最小化
(ByVal hwnd As Long, _
ByVal bRevert As Long) As Long
Private Declare Function GetWindowLong Lib "user32" _
Alias "GetWindowLongA" _
(ByVal hwnd As Long, _
ByVal nIndex As Long) As Long
Private Declare Function RemoveMenu Lib "user32" _
(ByVal hMenu As Long, _
ByVal nPosition As Long, _
ByVal wFlags As Long) As Long
Private Declare Function SetWindowLong Lib "user32" _
Alias "SetWindowLongA" _
(ByVal hwnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long
Private Sub SetForm()
Dim hSysMenu As Long, R As Long, J As Long
Dim dw As Long, rr As Long, i As Integer
Const MF_BYPOSITION = &H400
Const GWL_STYLE = (-16)
hSysMenu = GetSystemMenu(Me.hwnd, 0) RemoveMenu hSysMenu, 5, MF_BYPOSITION '去掉分隔线
RemoveMenu hSysMenu, 4, MF_BYPOSITION '去掉最大化
RemoveMenu(hSysMenu, 2, MF_BYPOSITION '去掉大小 dw = GetWindowLong(Me.hwnd, GWL_STYLE) ' 获得窗口的样式。
dw = dw And &HFFFEFFFF
rr = SetWindowLong(Me.hwnd, GWL_STYLE, dw)
End Sub
在MDIForm_load 中加入代码:
SetFrom然后窗体就不能改变到最大化和调整大小了,只能关闭和最小化
(ByVal hwnd As Long, _
ByVal bRevert As Long) As Long
Private Declare Function RemoveMenu Lib "user32" _
(ByVal hMenu As Long, _
ByVal nPosition As Long, _
ByVal wFlags As Long) As Long
Private Const MF_REMOVE = &H1000&
Private Const SC_MAXIMIZE = &HF030&
Private Const SC_SIZE = &HF000&Private Sub MDIForm_Load()
RemoveMenu GetSystemMenu(Me.hwnd, 0), SC_MAXIMIZE, MF_REMOVE
RemoveMenu GetSystemMenu(Me.hwnd, 0), SC_SIZE, MF_REMOVE
End Sub