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

[µo°Ý] vba¥i§_¨Ï¥Î®y¼Ð¨Ï·Æ¹««ö¤U¥ªÁä©Î¥kÁä

¦^´_ 9# Min
·PÁª©¥D¤j¤j,¤p§Ì¤w¸g¦b§Oªº°Q½×ª©¤W­±¦³¬Ý¨ìµª®×,¨Ã±N¥H¤À¨É
¦ý¤´¦³¹J¨ì°ÝÃD
ÁöµM¤U¤èµ{¦¡½X¥i¥H§ä¥X¿Ã¹õªº¤Ø¤o,¦ý§Úµo²{¤@¯ëªººô¯¸¤]·|®Ú¾Ú¤Ø¤oªº¤j¤p§@½Õ¾ã,¥i¬O¤£¬Oµ¥¤ñ¨Òªº½Õ¾ã
¾É­P¤U¤èªºµ{¦¡½XÁöµM¥i¥H¦Û¦æ½Õ¾ã¤ñ¨Ò,¥i¬O¤´µMÂI¤£¨ì­ì¥»¸ÓÂIªº¦ì¸m
  1. Public Declare Function GetSystemMetrics Lib "user32.dll" (ByVal index As Long) As Long
  2. Private Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long
  3. 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)
  4. Public Const XX = 1920
  5. Public Const YY = 1080
  6. Public Const SM_CXSCREEN = 0
  7. Public Const SM_CYSCREEN = 1
  8. Sub TEST()
  9. x = [A1]: y = [A2]
  10. xaxis = GetSystemMetrics(SM_CXSCREEN) / XX
  11. yaxis = GetSystemMetrics(SM_CYSCREEN) / YY
  12. SetCursorPos x * xaxis, y * yaxis '«ü©w·Æ¹«®y¼Ð
  13. 'mouse_event &H2 Or &H4, 0, 0, 0, 0 '¥ªÁäÂIÀ»
  14. 'mouse_event &H2 Or &H4, 0, 0, 0, 0 '¥ªÁäÂIÀ»

  15. End Sub
½Æ»s¥N½X
PKKO

TOP

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