肥龍 發表於 2008-12-25 22:59:35

隱藏滑鼠移動

隱藏滑鼠移動
Private Structure POINTAPI
      Dim x As Integer
      Dim y As Integer
    End Structure
    Private Structure RECT
      Dim Left As Integer
      Dim Top As Integer
      Dim Right As Integer
      Dim Bottom As Integer
    End Structure
    Private Structure WINDOWPLACEMENT
      Dim Length As Integer
      Dim flags As Integer
      Dim showCmd As Integer
      Dim ptMinPosition As POINTAPI
      Dim ptMaxPosition As POINTAPI
      Dim rcNormalPosition As RECT
    End Structure
    Private Declare Function GetWindowPlacement Lib "user32" (ByRef hwnd As Integer, ByRef lpwndpl As WINDOWPLACEMENT) As Integer
    Private Declare Function GetCursorPos Lib "user32" (ByRef lpPoint As POINTAPI) As Long
    Dim po As POINTAPI 'po點擊前滑鼠位置
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
      GetCursorPos(po)
      Call SetCursorPos(0, 100) '滑鼠移動到螢幕座標 X,Y(單位是圖元
      mouse_event(MOUSEEVENTF_ABSOLUTE Or MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
      System.Threading.Thread.Sleep(200)
      mouse_event(MOUSEEVENTF_ABSOLUTE Or MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
      SetCursorPos(po.x, po.y)
    End Sub

豆腐花子 發表於 2009-4-7 04:25:11

大大可以請教一下嗎
頁: [1]
查看完整版本: 隱藏滑鼠移動