Board logo

标题: [转贴] VBS调用AU3 [打印本页]

作者: pusofalse    时间: 2009-4-11 00:00     标题: VBS调用AU3

au3提供了此方面的接口,可以弥补vbs对窗口管理/按键等方面的不足。需要先注册AutoItX3.Dll
  1. ::注册
  2. regsvr32 AutoItX3.Dll
复制代码
  1. ::卸载
  2. regsvr32 /s /u AutoItX3.dll
复制代码
  1. AU3_AutoItSetOption
  2. AU3_BlockInput
  3. AU3_CDTray
  4. AU3_ClipGet
  5. AU3_ClipPut
  6. AU3_ControlClick
  7. AU3_ControlCommand
  8. AU3_ControlDisable
  9. AU3_ControlEnable
  10. AU3_ControlFocus
  11. AU3_ControlGetFocus
  12. AU3_ControlGetHandle
  13. AU3_ControlGetPosHeight
  14. AU3_ControlGetPosWidth
  15. AU3_ControlGetPosX
  16. AU3_ControlGetPosY
  17. AU3_ControlGetText
  18. AU3_ControlHide
  19. AU3_ControlListView
  20. AU3_ControlMove
  21. AU3_ControlSend
  22. AU3_ControlSetText
  23. AU3_ControlShow
  24. AU3_ControlTreeView
  25. AU3_DriveMapAdd
  26. AU3_DriveMapDel
  27. AU3_DriveMapGet
  28. AU3_IniDelete
  29. AU3_IniRead
  30. AU3_IniWrite
  31. AU3_Init
  32. AU3_IsAdmin
  33. AU3_MouseClick
  34. AU3_MouseClickDrag
  35. AU3_MouseDown
  36. AU3_MouseGetCursor
  37. AU3_MouseGetPosX
  38. AU3_MouseGetPosY
  39. AU3_MouseMove
  40. AU3_MouseUp
  41. AU3_MouseWheel
  42. AU3_Opt
  43. AU3_PixelChecksum
  44. AU3_PixelGetColor
  45. AU3_PixelSearch
  46. AU3_ProcessClose
  47. AU3_ProcessExists
  48. AU3_ProcessSetPriority
  49. AU3_ProcessWait
  50. AU3_ProcessWaitClose
  51. AU3_RegDeleteKey
  52. AU3_RegDeleteVal
  53. AU3_RegEnumKey
  54. AU3_RegEnumVal
  55. AU3_RegRead
  56. AU3_RegWrite
  57. AU3_Run
  58. AU3_RunAsSet
  59. AU3_RunWait
  60. AU3_Send
  61. AU3_Shutdown
  62. AU3_Sleep
  63. AU3_StatusbarGetText
  64. AU3_ToolTip
  65. AU3_WinActivate
  66. AU3_WinActive
  67. AU3_WinClose
  68. AU3_WinExists
  69. AU3_WinGetCaretPosX
  70. AU3_WinGetCaretPosY
  71. AU3_WinGetClassList
  72. AU3_WinGetClientSizeHeight
  73. AU3_WinGetClientSizeWidth
  74. AU3_WinGetHandle
  75. AU3_WinGetPosHeight
  76. AU3_WinGetPosWidth
  77. AU3_WinGetPosX
  78. AU3_WinGetPosY
  79. AU3_WinGetProcess
  80. AU3_WinGetState
  81. AU3_WinGetText
  82. AU3_WinGetTitle
  83. AU3_WinKill
  84. AU3_WinMenuSelectItem
  85. AU3_WinMinimizeAll
  86. AU3_WinMinimizeAllUndo
  87. AU3_WinMove
  88. AU3_WinSetOnTop
  89. AU3_WinSetState
  90. AU3_WinSetTitle
  91. AU3_WinSetTrans
  92. AU3_WinWait
  93. AU3_WinWaitActive
  94. AU3_WinWaitClose
  95. AU3_WinWaitNotActive
  96. AU3_error
复制代码
以下是在记事本失去焦点的情况下发送按键的例子。
  1. Option Explicit
  2. Dim oAutoIt, sTitle, iMinimize, iRestore, sControlID
  3. iMinimize = 6
  4. iRestore = 9
  5. sControlID = "Edit1"
  6. sTitle = "无标题 - 记事本"
  7. Set oAutoIt = WScript.CreateObject("AutoItX3.Control")
  8. oAutoIt.Run "C:\Windows\Notepad.exe"
  9. oAutoIt.WinWait sTitle
  10. oAutoIt.WinSetState sTitle, "", iMinimize
  11. oAutoIt.ControlSend sTitle, "", sControlID, "Test"
  12. oAutoIt.WinSetState sTitle, "", iRestore
  13. oAutoIt.WinClose sTitle, "Test"
  14. oAutoIt.WinWait "记事本", "已经改变"
  15. oAutoIt.ControlClick "记事本", "已经改变", "Button2"
复制代码
AutoItX3下载:
http://pan.baidu.com/share/link?shareid=3652782989&uk=1124163200
作者: lxzzr    时间: 2009-4-11 00:29

很好的一个贴子!!!!




欢迎光临 批处理之家 (http://bbs.bathome.net/) Powered by Discuz! 7.2