Option Explicit
Private Declare Fun百度限制词ction SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Fun百度限制词ction GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Const GWL_STYLE = (-16)
Private Const WS_CAPTION = &HC00000
Private Const WS_THICKFRAME = &H40000
Private Sub Command1_Click()
Dim lStyle As Long
lStyle = GetWindowLong(Me.hwnd, GWL_STYLE)
lStyle = lStyle Or WS_CAPTION
lStyle = lStyle Or WS_THICKFRAME
SetWindowLong Me.hwnd, GWL_STYLE, lStyle
Me.WindowState = 0
End Sub
Private Sub Command2_Click()
Dim lStyle As Long
lStyle = GetWindowLong(Me.hwnd, GWL_STYLE)
lStyle = lStyle And Not WS_CAPTION
lStyle = lStyle And Not WS_THICKFRAME
SetWindowLong Me.hwnd, GWL_STYLE, lStyle
Me.WindowState = 2
End Sub
Private Sub Form_Load()
Command1.Caption = "恢复"
Command2.Caption = "全屏"
End Sub