通过如下语句更改无标题栏窗口得大小是为什么只能更改横向大小?
Public Declare Function ClientToScreen Lib "user32" (ByVal hwnd As Long, lpPoint As POINTAPI) As Long
'释放程序鼠标捕获
Public Declare Function ReleaseCapture Lib "user32" _
( _
) As Long
'发送一条消息
Public Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" _
( _
ByVal hwnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, lParam As Any _
) As Long
Public Const WM_SYSCOMMAND = &H112
Public Const HTCAPTION = 2
Public Const SC_SIZE = &HF000&
private Sub SetSize()
If Button = 1 Then
X1 = ReleaseCapture()
ReturnVal1 = SendMessage(Me.hwnd, WM_SYSCOMMAND, _
SC_SIZE + HTCAPTION, 0)
End If
End If
ReturnVal1 = SendMessage(Me.hwnd, WM_SYSCOMMAND, _
SC_SIZE Or 6 + HTCAPTION, 0)
Private Declare Function ReleaseCapture Lib "user32" _
( _
) As Long
'发送一条消息
Private Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" _
( _
ByVal hwnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, lParam As Any _
) As Long
Private Const WM_SYSCOMMAND = &H112
Private Const HTCAPTION = 2
Private Const HTHSCROLL = 6
Private Const SC_SIZE = &HF000&
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
X1 = ReleaseCapture()
ReturnVal1 = SendMessage(Me.hwnd, WM_SYSCOMMAND, _
SC_SIZE + HTHSCROLL + HTCAPTION, 0)
End If
End Sub