level 3
Option Explicit
Dim a, b
Private Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long
Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Private Const MOUSEEVENTF_LEFTDOWN = &H2
Private Const MOUSEEVENTF_LEFTUP = &H4
Private Sub Command1_Click()
a = Form1.Height / 2 + Form1.Top
b = Form1.Width / 2 + Form1.Left
a = ScaleX(a, 1, 3)
b = ScaleY(b, 1, 3)
Call SetCursorPos(b, a)
mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0
mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0 'top,height,left,width
End Sub
在按下command1后点击窗口中心.....
2012年08月01日 02点08分