ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

¦p¦óºÊ±±·Æ¹«ÂIÀ»¬Y­Ó¦ì¸m

¦p¦óºÊ±±·Æ¹«ÂIÀ»¬Y­Ó¦ì¸m

¥»©«³Ì«á¥Ñ cdkee ©ó 2010-11-7 01:01 ½s¿è

½Ð±Ð¤j¤j¡A¥ÎVBAºÊ±±·Æ¹«ÂIÀ»µe­±¤Wªº¥¿¤¤¦ì¸m®y¼Ð¡AÀ³¸Ó«ç¼Ë¼g¡AÁÂÁÂ!

¦^´_ 4# Min


    ÁÂÁª©¤j±Ð±Â!¥i¥H¤F!

TOP

¤@­Ó²³æªº"²¾°Ê·Æ¹«ÂI撃" API«o¬O¦n´X­Ó°Ê§@
­n¬¡¥ÎAPI ¥ý­n¤F¸Ñ¦³­þ¤@¨ÇAPI¥i¥H¥Î~ (¤p§Ì¤£¤~ ·|¥Îªº¤]¥u¦³³o´X­Ó>"<)
§Ú­Ì©î¨â­Ó³¡¤À¨Ó½Í 1.·Æ¹«²¾°Ê 2.·Æ¹«³]©w

1.·Æ¹«²¾°Ê XY´N¬O±zªº®y¼Ð ¦Ü©ó¦p¦ó²¾°Ê¨ì"µe­±¥¿¤¤¥¡¦ì¸m" ´N¦Û¤vºâ¤F~
Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long
Sub MoveMouse()
    Dim X As Integer
    Dim Y As Integer
    X = 500
    Y = 150
    Call SetCursorPos(X, Y)
End Sub

2.·Æ¹«³]©w
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)
Sub SetMouse()
    Call mouse_event(&H2 Or &H4, 0, 0, 0, 0)
End Sub
&H2 ´N¬O¥ªÁä«ö¤U
&H4 ´N¬O¥ªÁä©ñ¶}
­Y¬O§Ú¦^µª¡A¨Ï±zº¡·N¡A½Ð±zÅý§Úª¾¹D¡I                  
­Y¬O§Úªº¦^ÂСA±z¤´¦³¨ä¥L¨£¸Ñ¡A¤]½Ð±z¤£¶Þ«ü±Ð¡I

TOP

¦^´_ 2# Min


    ÁÂÁª©¤j!¬O¤p½ú»¡¤£²M·¡¡A¬O±±¨î·Æ¹«ÂI撃µe­±¥¿¤¤¦ì¸m¡C

TOP

­n¥Î¨ìAPI³á~

Private Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Type POINTAPI
    X As Long
    Y As Long
End Type
Public Function GethWnd() As Long
    Dim lpPoint As POINTAPI
    GetCursorPos lpPoint
    GethWnd = WindowFromPoint(lpPoint.X, lpPoint.Y)
    MsgBox lpPoint.X
    MsgBox lpPoint.Y
End Function
­Y¬O§Ú¦^µª¡A¨Ï±zº¡·N¡A½Ð±zÅý§Úª¾¹D¡I                  
­Y¬O§Úªº¦^ÂСA±z¤´¦³¨ä¥L¨£¸Ñ¡A¤]½Ð±z¤£¶Þ«ü±Ð¡I

TOP

        ÀR«ä¦Û¦b : ¤f»¡¤@¥y¦n¸Ü¡A¦p¤f¥X½¬ªá¡F¤f»¡¤@¥yÃa¸Ü¦p¤f¦R¬r³D¡C
ªð¦^¦Cªí ¤W¤@¥DÃD