# 没这么难吧!

Posted by 小吴 on June 03, 1998 at 00:26:01:

In Reply to: 如何利用工作区移动视窗? posted by 阿强 on June 02, 1998 at 17:28:13:

1. 你的第一个问题只要用下面这段程式就行了!

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 Declare Sub ReleaseCapture Lib "User32" ()
Const WM_NCLBUTTONDOWN = &HA1
Const HTCAPTION = 2
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, _
X As Single, Y As Single)
Dim lngReturnValue As Long
If Button = 1 Then
ReleaseCapture
lngReturnValue = SendMessage(hWnd, WM_NCLBUTTONDOWN, HTCAPTION, 0&)
End If
End Sub

2. 我建议你直接使用 ShellExecute(Ex) API 来执行你要的功能。

Follow Ups: