在窗口没有窗体边框和标题栏的情况下 怎样改变窗口大小?
在窗口没有窗体边框和标题栏的情况下 怎样改变窗口大小 ?Declare Function SendMessage Lib "user32" Alias "SendMessageA" ( _
ByVal hwnd As IntPtr, _
ByVal wMsg As Integer, _
ByVal wParam As Integer, _
ByVal lParam As Integer) _
As Boolean
Declare Function ReleaseCapture Lib "user32" Alias "ReleaseCapture" () As Boolean
Const WM_SYSCOMMAND = &H112
Const SC_MOVE = &HF010&
Const HTCAPTION = 2
Private Sub Form1_MouseDown(ByVal sender As Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) _
Handles MyBase.MouseDown
ReleaseCapture()
SendMessage(Me.Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0)
End Sub
我在VB.net 2005 下执行该代码报异常(SendMessage(Me.Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0))。不知什么原因?
实际运行过程中始终报异常
[此贴子已经被作者于2007-7-25 14:26:20编辑过]