'添加 Command1
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex 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 Declare Function GetSystemMenu Lib "user32" (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
Const MF_BYPOSITION = &H400&
Const MF_REMOVE = &H1000&
Sub Form_Load()
Dim hSysMenu As Long
Dim r%, j%, dw&, rr&
Const MF_BYPOSITION = &H400
hSysMenu = GetSystemMenu(Me.hwnd, 0)
For j = 8 To 4 Step -1
r = RemoveMenu(hSysMenu, j, MF_BYPOSITION)
Next j
dw& = GetWindowLong(Me.hwnd, -16) 'Window style
dw& = dw& And &HFFFEFFFF 'Turn off bits for Maximize arrow button
rr& = SetWindowLong(Me.hwnd, -16, dw&)
Command1.Caption = "退出"
End Sub
Private Sub Command1_Click()
End
End Sub
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex 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 Declare Function GetSystemMenu Lib "user32" (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
Const MF_BYPOSITION = &H400&
Const MF_REMOVE = &H1000&
Sub Form_Load()
Dim hSysMenu As Long
Dim r%, j%, dw&, rr&
Const MF_BYPOSITION = &H400
hSysMenu = GetSystemMenu(Me.hwnd, 0)
For j = 8 To 4 Step -1
r = RemoveMenu(hSysMenu, j, MF_BYPOSITION)
Next j
dw& = GetWindowLong(Me.hwnd, -16) 'Window style
dw& = dw& And &HFFFEFFFF 'Turn off bits for Maximize arrow button
rr& = SetWindowLong(Me.hwnd, -16, dw&)
Command1.Caption = "退出"
End Sub
Private Sub Command1_Click()
End
End Sub