下面是最簡化 的方式 vb6 的 寫法 vb.net 也可以用
Private Declare Function ReleaseCapture Lib “user32” ()AsLong
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
Const WM_SYSCOMMAND = &H112
Const SC_MOVE = &HF012
紫色這段 最好是放在 時間裡面 這樣才能有效果(因為一直迴圈跑)
ReleaseCapture
移動視窗
SendMessage Me.hwnd, WM_SYSCOMMAND, SC_MOVE, 0