用SetCapture ReleaseCapture API,在98下运行正常,在2000下就不能拖动窗口了.

解决方案 »

  1.   

    给我Email,我给你一个类,可以解决问题。
    [email protected]
      

  2.   

    实例如下
    *API函数声明: 
    Declare Function ReleaseCapture Lib "user32" () As Long 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 HTCAPTION = 2 
    Public Const WM_NCLBUTTONDOWN = &HA1 
    在 Form_MouseDown 事件中: 
    Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) 
    ReleaseCapture SendMessage hwnd, WM_NCLBUTTONDOWN, HTCAPTION,0& 
    End Sub