Permalink
Browse files

update to 3.3.13.12

  • Loading branch information...
1 parent ef154df commit 3eb603403dca438703afdf83b2e40b3ea006f568 thegfw committed Jul 30, 2014
Showing with 15,280 additions and 13,871 deletions.
  1. +103 −1 Au3Check.dat
  2. BIN Au3Check.exe
  3. BIN Au3Info.exe
  4. BIN Au3Info_x64.exe
  5. BIN Aut2Exe/Aut2exe.exe
  6. BIN Aut2Exe/Aut2exe_x64.exe
  7. BIN AutoIt3.chm
  8. BIN AutoIt3.exe
  9. BIN AutoIt3_x64.exe
  10. BIN AutoItX/AutoItX.chm
  11. BIN AutoItX/AutoItX3.Assembly.dll
  12. BIN AutoItX/AutoItX3.PowerShell.dll
  13. BIN AutoItX/AutoItX3.dll
  14. BIN AutoItX/AutoItX3.psd1
  15. BIN AutoItX/AutoItX3_DLL.lib
  16. BIN AutoItX/AutoItX3_x64.dll
  17. BIN AutoItX/AutoItX3_x64_DLL.lib
  18. +23 −17 Examples/COM/AutoItX-test.au3
  19. +21 −23 Examples/COM/ErrorEventTest-ADSI.au3
  20. +41 −35 Examples/COM/ErrorEventTest-WMI.AU3
  21. +35 −37 Examples/COM/EventTest-IE6.au3
  22. +45 −47 Examples/COM/EventTest-SAPI.au3
  23. +21 −23 Examples/COM/EventTest-ShellWindows.au3
  24. +19 −21 Examples/COM/EventTest-WMI.au3
  25. +11 −11 Examples/COM/ExcelAutomationTest.au3
  26. +20 −20 Examples/COM/ExcelDataTest.AU3
  27. +14 −16 Examples/COM/ExcelFastTest.au3
  28. +14 −16 Examples/COM/ExcelFileTest.au3
  29. +3 −6 Examples/COM/ExcelGetObjTest.au3
  30. +22 −23 Examples/COM/FileSearchTest.au3
  31. +14 −14 Examples/COM/Instance-of-IE-test.au3
  32. +18 −20 Examples/COM/RegExpTest.au3
  33. +20 −22 Examples/COM/RemoteObjCreateTest.au3
  34. +213 −213 Examples/COM/Scriptomatic.au3
  35. +2 −8 Examples/COM/ShellStopStartServiceTest.au3
  36. +8 −8 Examples/COM/ShellWindowsTest.au3
  37. +9 −9 Examples/COM/Wmi-terminate.au3
  38. +26 −15 Examples/COM/WmiDiskTest.au3
  39. +10 −11 Examples/COM/WmiGetStringValue.AU3
  40. +17 −8 Examples/COM/WordTest.au3
  41. +8 −11 Examples/COM/WscriptFilesys.au3
  42. +25 −19 Examples/COM/getHTMLsource.au3
  43. +22 −22 Examples/COM/winntgroups.au3
  44. +11 −7 Examples/COM/wmiForInTest.au3
  45. +27 −17 Examples/COM/wmiexample.AU3
  46. +30 −24 Examples/COM/wscriptnetwork.au3
  47. +8 −10 Examples/COM/wscriptshelltest.au3
  48. +14 −14 Examples/GUI/Advanced/AlphaBlend.au3
  49. +4 −9 Examples/GUI/Advanced/BMPToJPG.au3
  50. +106 −106 Examples/GUI/Advanced/Clock.au3
  51. +3 −3 Examples/GUI/Advanced/Emboss.au3
  52. +4 −9 Examples/GUI/Advanced/Rotate.au3
  53. +3 −8 Examples/GUI/Advanced/ShowPNG.au3
  54. +7 −7 Examples/GUI/Advanced/Slicer.au3
  55. +7 −13 Examples/GUI/Advanced/Zoom.au3
  56. +22 −22 Examples/GUI/Advanced/_NamedPipes_Client.au3
  57. +37 −37 Examples/GUI/Advanced/_NamedPipes_Server.au3
  58. +8 −8 Examples/GUI/Advanced/contextmenu.au3
  59. +43 −43 Examples/GUI/Advanced/dice.au3
  60. +58 −53 Examples/GUI/Advanced/encrypt.au3
  61. +40 −39 Examples/GUI/Advanced/enumicons.au3
  62. +16 −16 Examples/GUI/Advanced/imagebutton.au3
  63. +23 −23 Examples/GUI/Advanced/menu.au3
  64. +10 −10 Examples/GUI/Advanced/setlabel.au3
  65. +42 −42 Examples/GUI/Advanced/sysinfo.au3
  66. +54 −54 Examples/GUI/Advanced/treeview.au3
  67. +12 −12 Examples/GUI/Simple/child.au3
  68. +13 −13 Examples/GUI/Simple/editbox.au3
  69. +12 −12 Examples/GUI/Simple/msgbox_messageloop.au3
  70. +10 −10 Examples/GUI/Simple/msgbox_onevent.au3
  71. +37 −37 Examples/GUI/Simple/simplecalc.au3
  72. +1 −1 Examples/Helpfile/@OSLang.au3
  73. +341 −341 Examples/Helpfile/Extras/WMDebug.au3
  74. +28 −14 Examples/Helpfile/_ArrayAdd.au3
  75. +1 −2 Include/APIComConstants.au3
  76. +1 −3 Include/APIConstants.au3
  77. +1 −2 Include/APIDiagConstants.au3
  78. +1 −2 Include/APIDlgConstants.au3
  79. +1 −2 Include/APIErrorsConstants.au3
  80. +1 −2 Include/APIFilesConstants.au3
  81. +1 −2 Include/APIGdiConstants.au3
  82. +1 −2 Include/APILocaleConstants.au3
  83. +1 −2 Include/APIMiscConstants.au3
  84. +1 −2 Include/APIProcConstants.au3
  85. +1 −2 Include/APIRegConstants.au3
  86. +1 −2 Include/APIResConstants.au3
  87. +1 −2 Include/APIShPathConstants.au3
  88. +1 −2 Include/APIShellExConstants.au3
  89. +1 −2 Include/APISysConstants.au3
  90. +1 −2 Include/APIThemeConstants.au3
  91. +2 −2 Include/AVIConstants.au3
  92. +1,254 −461 Include/Array.au3
  93. +2 −2 Include/AutoItConstants.au3
  94. +1 −1 Include/BorderConstants.au3
  95. +1 −1 Include/ButtonConstants.au3
  96. +1 −2 Include/Clipboard.au3
  97. +9 −9 Include/Color.au3
  98. +1 −1 Include/ColorConstants.au3
  99. +1 −1 Include/ComboConstants.au3
  100. +1 −1 Include/Constants.au3
  101. +26 −27 Include/Crypt.au3
  102. +50 −51 Include/Date.au3
  103. +5 −5 Include/DateTimeConstants.au3
  104. +107 −107 Include/Debug.au3
  105. +1 −1 Include/DirConstants.au3
  106. +1 −1 Include/EditConstants.au3
  107. +11 −11 Include/EventLog.au3
  108. +960 −650 Include/Excel.au3
  109. +280 −281 Include/FTPEx.au3
  110. +199 −70 Include/File.au3
  111. +1 −1 Include/FileConstants.au3
  112. +1 −1 Include/FontConstants.au3
  113. +1 −1 Include/FrameConstants.au3
  114. +382 −381 Include/GDIPlus.au3
  115. +35 −9 Include/GDIPlusConstants.au3
  116. +1 −1 Include/GUIConstants.au3
  117. +1 −1 Include/GUIConstantsEx.au3
  118. +13 −13 Include/GuiAVI.au3
  119. +42 −42 Include/GuiButton.au3
  120. +25 −26 Include/GuiComboBox.au3
  121. +30 −30 Include/GuiComboBoxEx.au3
  122. +17 −17 Include/GuiDateTimePicker.au3
  123. +121 −121 Include/GuiEdit.au3
  124. +56 −56 Include/GuiHeader.au3
  125. +24 −25 Include/GuiIPAddress.au3
  126. +11 −12 Include/GuiImageList.au3
  127. +70 −70 Include/GuiListBox.au3
  128. +386 −386 Include/GuiListView.au3
  129. +134 −137 Include/GuiMenu.au3
  130. +73 −73 Include/GuiMonthCal.au3
  131. +117 −118 Include/GuiReBar.au3
  132. +499 −505 Include/GuiRichEdit.au3
  133. +89 −90 Include/GuiScrollBars.au3
  134. +32 −32 Include/GuiSlider.au3
  135. +56 −57 Include/GuiStatusBar.au3
  136. +66 −66 Include/GuiTab.au3
  137. +70 −70 Include/GuiToolTip.au3
  138. +115 −115 Include/GuiToolbar.au3
  139. +139 −140 Include/GuiTreeView.au3
  140. +1 −1 Include/HeaderConstants.au3
  141. +1,914 −1,925 Include/IE.au3
  142. +1 −1 Include/IPAddressConstants.au3
  143. +1 −1 Include/ImageListConstants.au3
  144. +125 −112 Include/Inet.au3
  145. +1 −1 Include/InetConstants.au3
  146. +1 −1 Include/ListBoxConstants.au3
  147. +1 −1 Include/ListViewConstants.au3
  148. +6 −10 Include/Math.au3
  149. +9 −10 Include/Memory.au3
  150. +1 −1 Include/MemoryConstants.au3
  151. +7 −1 Include/MenuConstants.au3
  152. +55 −56 Include/Misc.au3
  153. +1 −1 Include/MsgBoxConstants.au3
  154. +1 −2 Include/NTSTATUSConstants.au3
  155. +1 −2 Include/NamedPipes.au3
  156. +1 −2 Include/NetShare.au3
  157. +1 −1 Include/Process.au3
  158. +1 −1 Include/ProcessConstants.au3
  159. +1 −1 Include/ProgressConstants.au3
  160. +1 −1 Include/RebarConstants.au3
  161. +1 −1 Include/RichEditConstants.au3
  162. +185 −179 Include/SQLite.au3
  163. +3 −3 Include/SQLite.dll.au3
  164. +43 −42 Include/ScreenCapture.au3
  165. +1 −1 Include/ScrollBarConstants.au3
  166. +1 −1 Include/ScrollBarsConstants.au3
  167. +13 −14 Include/Security.au3
  168. +1 −1 Include/SecurityConstants.au3
  169. +1 −2 Include/SendMessage.au3
  170. +1 −1 Include/SliderConstants.au3
  171. +28 −28 Include/Sound.au3
  172. +9 −1 Include/StaticConstants.au3
  173. +1 −1 Include/StatusBarConstants.au3
  174. +28 −31 Include/String.au3
  175. +2 −2 Include/StringConstants.au3
  176. +16 −1 Include/StructureConstants.au3
  177. +1 −1 Include/TabConstants.au3
  178. +31 −32 Include/Timers.au3
  179. +1 −1 Include/ToolTipConstants.au3
  180. +1 −1 Include/ToolbarConstants.au3
  181. +1 −1 Include/TrayConstants.au3
  182. +5 −1 Include/TreeViewConstants.au3
  183. +26 −26 Include/UDFGlobalID.au3
  184. +1 −1 Include/UpDownConstants.au3
  185. +193 −194 Include/Visa.au3
  186. +195 −195 Include/WinAPI.au3
  187. +13 −15 Include/WinAPICom.au3
  188. +2 −2 Include/WinAPIConstants.au3
  189. +319 −322 Include/WinAPIDiag.au3
  190. +143 −145 Include/WinAPIDlg.au3
  191. +1 −1 Include/WinAPIError.au3
  192. +2 −36 Include/WinAPIEx.au3
  193. +461 −460 Include/WinAPIFiles.au3
  194. +1,180 −1,181 Include/WinAPIGdi.au3
  195. +118 −121 Include/WinAPIInternals.au3
  196. +121 −123 Include/WinAPILocale.au3
  197. +45 −55 Include/WinAPIMisc.au3
  198. +376 −376 Include/WinAPIProc.au3
  199. +146 −148 Include/WinAPIReg.au3
  200. +267 −269 Include/WinAPIRes.au3
  201. +198 −200 Include/WinAPIShPath.au3
  202. +204 −206 Include/WinAPIShellEx.au3
  203. +589 −591 Include/WinAPISys.au3
  204. +132 −134 Include/WinAPITheme.au3
  205. +1 −2 Include/WinAPIlangConstants.au3
  206. +1 −2 Include/WinAPIsysinfoConstants.au3
  207. +1 −2 Include/WinAPIvkeysConstants.au3
  208. +7 −8 Include/WinNet.au3
  209. +2 −2 Include/WindowsConstants.au3
  210. +2 −3 Include/Word.au3
  211. +2 −2 Include/WordConstants.au3
  212. +575 −469 SciTe/api/au3.api
  213. +101 −98 SciTe/属性文件/au3.keywords.properties
View
@@ -109,7 +109,7 @@ $CmdLineRaw
!FileDelete 1 1
!FileExists 1 1
!FileFindFirstFile 1 1
-!FileFindNextFile 1 1
+!FileFindNextFile 1 2
!FileFlush 1 1
!FileGetAttrib 1 1
!FileGetEncoding 1 2
@@ -132,6 +132,7 @@ $CmdLineRaw
!FileSaveDialog 3 6
!FileSelectFolder 2 5
!FileSetAttrib 2 3
+!FileSetEnd 1 1
!FileSetPos 3 3
!FileSetTime 2 4
!FileWrite 2 2
@@ -240,11 +241,16 @@ $CmdLineRaw
!IsHWnd 1 1
!IsInt 1 1
!IsKeyword 1 1
+!IsMap 1 1
!IsNumber 1 1
!IsObj 1 1
!IsPtr 1 1
!IsString 1 1
!Log 1 1
+!MapAppend 2 2
+!MapExists 2 2
+!MapKeys 1 1
+!MapRemove 2 2
!MemGetStats 0 0
!Mod 2 2
!MouseClick 1 5
@@ -415,6 +421,36 @@ $CmdLineRaw
%AdlibRegister 1 <UDF>
%AdlibUnRegister 1 <UDF>
+%AutoItSetOption 1 CaretCoordMode
+%AutoItSetOption 1 ExpandEnvStrings
+%AutoItSetOption 1 ExpandVarStrings
+%AutoItSetOption 1 GUICloseOnESC
+%AutoItSetOption 1 GUICoordMode
+%AutoItSetOption 1 GUIDataSeparatorChar
+%AutoItSetOption 1 GUIEventOptions
+%AutoItSetOption 1 GUIOnEventMode
+%AutoItSetOption 1 GUIResizeMode
+%AutoItSetOption 1 MouseClickDelay
+%AutoItSetOption 1 MouseClickDownDelay
+%AutoItSetOption 1 MouseClickDragDelay
+%AutoItSetOption 1 MouseCoordMode
+%AutoItSetOption 1 MustDeclareVars
+%AutoItSetOption 1 PixelCoordMode
+%AutoItSetOption 1 SendAttachMode
+%AutoItSetOption 1 SendCapslockMode
+%AutoItSetOption 1 SendKeyDelay
+%AutoItSetOption 1 SendKeyDownDelay
+%AutoItSetOption 1 TCPTimeout
+%AutoItSetOption 1 TrayAutoPause
+%AutoItSetOption 1 TrayIconDebug
+%AutoItSetOption 1 TrayIconHide
+%AutoItSetOption 1 TrayMenuMode
+%AutoItSetOption 1 TrayOnEventMode
+%AutoItSetOption 1 WinDetectHiddenText
+%AutoItSetOption 1 WinSearchChildren
+%AutoItSetOption 1 WinTextMatchMode
+%AutoItSetOption 1 WinTitleMatchMode
+%AutoItSetOption 1 WinWaitDelay
%Call 1 <UDF_P>
%ControlClick 4 ''
%ControlClick 4 left
@@ -424,6 +460,42 @@ $CmdLineRaw
%ControlClick 4 primary
%ControlClick 4 right
%ControlClick 4 secondary
+%ControlCommand 4 AddString
+%ControlCommand 4 Check
+%ControlCommand 4 CurrentTab
+%ControlCommand 4 DelString
+%ControlCommand 4 EditPaste
+%ControlCommand 4 FindString
+%ControlCommand 4 GetCurrentCol
+%ControlCommand 4 GetCurrentLine
+%ControlCommand 4 GetCurrentSelection
+%ControlCommand 4 GetLine
+%ControlCommand 4 GetLineCount
+%ControlCommand 4 GetSelected
+%ControlCommand 4 HideDropDown
+%ControlCommand 4 IsChecked
+%ControlCommand 4 IsEnabled
+%ControlCommand 4 IsVisible
+%ControlCommand 4 SelectString
+%ControlCommand 4 SendCommandID
+%ControlCommand 4 SetCurrentSelection
+%ControlCommand 4 ShowDropDown
+%ControlCommand 4 TabLeft
+%ControlCommand 4 TabRight
+%ControlCommand 4 UnCheck
+%ControlListView 4 DeSelect
+%ControlListView 4 FindItem
+%ControlListView 4 GetItemCount
+%ControlListView 4 GetSelected
+%ControlListView 4 GetSelectedCount
+%ControlListView 4 GetSubItemCount
+%ControlListView 4 GetText
+%ControlListView 4 IsSelected
+%ControlListView 4 Select
+%ControlListView 4 SelectAll
+%ControlListView 4 SelectClear
+%ControlListView 4 SelectInvert
+%ControlListView 4 ViewChange
%GUICtrlSetOnEvent 2 <UDF>
%GUIRegisterMsg 2 <UDF_P>
%GUISetOnEvent 2 <UDF>
@@ -462,6 +534,36 @@ $CmdLineRaw
%MouseUp 1 secondary
%OnAutoItExitRegister 1 <UDF>
%OnAutoItExitUnRegister 1 <UDF>
+%Opt 1 CaretCoordMode
+%Opt 1 ExpandEnvStrings
+%Opt 1 ExpandVarStrings
+%Opt 1 GUICloseOnESC
+%Opt 1 GUICoordMode
+%Opt 1 GUIDataSeparatorChar
+%Opt 1 GUIEventOptions
+%Opt 1 GUIOnEventMode
+%Opt 1 GUIResizeMode
+%Opt 1 MouseClickDelay
+%Opt 1 MouseClickDownDelay
+%Opt 1 MouseClickDragDelay
+%Opt 1 MouseCoordMode
+%Opt 1 MustDeclareVars
+%Opt 1 PixelCoordMode
+%Opt 1 SendAttachMode
+%Opt 1 SendCapslockMode
+%Opt 1 SendKeyDelay
+%Opt 1 SendKeyDownDelay
+%Opt 1 TCPTimeout
+%Opt 1 TrayAutoPause
+%Opt 1 TrayIconDebug
+%Opt 1 TrayIconHide
+%Opt 1 TrayMenuMode
+%Opt 1 TrayOnEventMode
+%Opt 1 WinDetectHiddenText
+%Opt 1 WinSearchChildren
+%Opt 1 WinTextMatchMode
+%Opt 1 WinTitleMatchMode
+%Opt 1 WinWaitDelay
%RegWrite 3 REG_BINARY
%RegWrite 3 REG_DWORD
%RegWrite 3 REG_EXPAND_SZ
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
Binary file not shown.
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,30 +1,36 @@
-#include <Constants.au3>
+#include <MsgBoxConstants.au3>
-; AutoIt 3.1.1.x beta version
-;
; COM Test file
;
; Test usage of AutoItX from within AutoItCOM
-Local $oAutoIt = ObjCreate("AutoItX3.Control")
-If @error Then
- MsgBox($MB_SYSTEMMODAL, "AutoItX Test", "Failed to open AutoItX. Error code: " & Hex(@error, 8))
- Exit
-EndIf
+Example("I am copied to the clipboard")
+Exit
+
+Func Example($sExampleText)
+
+ Local $oAutoIt = ObjCreate("AutoItX3.Control")
+ If @error Then
+ MsgBox($MB_SYSTEMMODAL, "AutoItX Test", "Failed to open AutoItX. Error code: " & Hex(@error, 8))
+ Return -1
+ EndIf
-$oAutoIt.ClipPut("I am copied to the clipboard")
+ $oAutoIt.ClipPut($sExampleText)
-Local $text = $oAutoIt.ClipGet()
+ Local $sTextFromClipboard = $oAutoIt.ClipGet()
+ Local $sTestInfo = "Clipboard contains: " & $sTextFromClipboard & @CRLF & @CRLF & "Press OK to create a tooltip in the upper left corner."
-MsgBox($MB_SYSTEMMODAL, "Clipboard test", "Clipboard contains: " & $text)
+ MsgBox($MB_SYSTEMMODAL, "Clipboard test", $sTestInfo)
-; This will create a tooltip in the upper left of the screen
+ ; This will create a tooltip in the upper left of the screen
+ $oAutoIt.ToolTip("This is a tooltip", 0, 0)
-MsgBox($MB_SYSTEMMODAL, "Tooltip test", "Press OK to create a tooltip in the upper left corner.")
+ ; Sleep to give tooltip time to display
+ $oAutoIt.Sleep(1000)
-$oAutoIt.ToolTip("This is a tooltip", 0, 0)
-$oAutoIt.Sleep(1000) ; Sleep to give tooltip time to display
+ MsgBox($MB_SYSTEMMODAL, "End of Test", "OK")
-Local $var = $oAutoIt.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion", "ProgramFilesDir")
+ ; CleanUp - relase memory
+ $oAutoIt = ''
-MsgBox($MB_SYSTEMMODAL, "RegRead Test", "Program files are in:" & $var)
+EndFunc ;==>Example
@@ -1,57 +1,55 @@
-#include <Constants.au3>
+#include <MsgBoxConstants.au3>
-; AutoIt 3.1.1.x beta version
-;
-; COM Test File
+; COM Test file
;
; Error Event test using Winnt ADSI
;
; This will cause an ErrorEvent on most computers.
; Initialize my Error function
-Local $g_oErrObj = ObjEvent("AutoIt.Error", "MyErrFunc")
+Local $oErrObj = ObjEvent("AutoIt.Error", "MyErrFunc")
; Open Winnt object on local machine, this might take a few seconds time.
-Local $objContainer = ObjGet("WinNT://" & @ComputerName)
+Local $oContainer = ObjGet("WinNT://" & @ComputerName)
If @error Then
MsgBox($MB_SYSTEMMODAL, "AutoItCOM Test", "Failed to open WinNT://. Error code: " & Hex(@error, 8))
Exit
EndIf
-Local $strUser = "CBrooke"
-Local $clsUser = $objContainer.Create("User", $strUser)
+Local $sUser = "CBrooke"
+Local $oUser = $oContainer.Create("User", $sUser)
; This will only succeed on computers where local user passwords are allowed to be empty.
-$clsUser.SetInfo()
+$oUser.SetInfo()
; The line below should throw an Error after a short timeout,
; because "domain" and "MyGroup" do not exist.
-Local $objGroup = ObjGet("WinNT://domain/MyGroup, group")
+Local $oGroup = ObjGet("WinNT://domain/MyGroup, group")
If @error Then
- MsgBox($MB_SYSTEMMODAL, "", "error opening object $objGroup, error code: " & @error)
+ MsgBox($MB_SYSTEMMODAL, "", "error opening object $oGroup, error code: " & @error)
Exit
Else
- $objGroup.Add($clsUser.ADsPath)
- $objGroup.SetInfo()
+ $oGroup.Add($oUser.ADsPath)
+ $oGroup.SetInfo()
EndIf
Exit
; ----------------
-Func MyErrFunc($oerrobj)
- Local $hexnum = Hex($oerrobj.number, 8)
+Func MyErrFunc($oErrObj)
+ Local $sHexnum = Hex($oErrObj.number, 8)
MsgBox($MB_SYSTEMMODAL, "", "We intercepted a COM Error!!" & @CRLF & @CRLF & _
- "err.description is: " & $oerrobj.description & @CRLF & _
- "err.windescription is: " & $oerrobj.windescription & @CRLF & _
- "err.lastdllerror is: " & $oerrobj.lastdllerror & @CRLF & _
- "err.scriptline is: " & $oerrobj.scriptline & @CRLF & _
- "err.number is: " & $hexnum & @CRLF & _
- "err.source is: " & $oerrobj.source & @CRLF & _
- "err.helpfile is: " & $oerrobj.helpfile & @CRLF & _
- "err.helpcontext is: " & $oerrobj.helpcontext _
+ "err.description is: " & $oErrObj.description & @CRLF & _
+ "err.windescription is: " & $oErrObj.windescription & @CRLF & _
+ "err.lastdllerror is: " & $oErrObj.lastdllerror & @CRLF & _
+ "err.scriptline is: " & $oErrObj.scriptline & @CRLF & _
+ "err.number is: " & $sHexnum & @CRLF & _
+ "err.source is: " & $oErrObj.source & @CRLF & _
+ "err.helpfile is: " & $oErrObj.helpfile & @CRLF & _
+ "err.helpcontext is: " & $oErrObj.helpcontext _
)
EndFunc ;==>MyErrFunc
@@ -1,53 +1,59 @@
-#include <Constants.au3>
+#include <MsgBoxConstants.au3>
-; AutoIt 3.1.1.x beta
-;
-; COM Test File
+; COM Test file
;
; Testing Error Event handling by creating a WMI exception
-Local $MyCompName = @ComputerName
+; Initialize error handler
+Global $g_nComError = ''
+Global $g_oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")
+
+Example()
+Exit
-; Initialize my error handler
-Global $g_nComError, $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")
+Func Example()
-; Open WMI
-Local $oWMIservice = ObjGet("winmgmts:\\" & $MyCompName & "\root\cimv2")
+ ; Open WMI
+ Local $oWMIservice = ObjGet("winmgmts:\\" & @ComputerName & "\root\cimv2")
-; Check is WMI opened successfully
-If @error Then
- MsgBox($MB_SYSTEMMODAL, "AutoItCOM Test", "Error getting object $oWMIservice. Error code: " & @error)
- Exit
-EndIf
+ ; Check is WMI opened successfully
+ If @error Then
+ MsgBox($MB_SYSTEMMODAL, "AutoItCOM Test", "Error getting object $oWMIservice. Error code: " & @error)
+ Exit
+ EndIf
-; Try a query
-Local $ColProcessors = $oWMIservice.ExecQuery("Select * from Win32_Processor")
+ ; Try a query
+ Local $oColProcessors = $oWMIservice.ExecQuery("Select * from Win32_Processor")
-; THIS line should deliberately fail!
-Local $item1 = $ColProcessors.item(1)
+ ; THIS line should deliberately fail!
+ Local $vItem1 = $oColProcessors.item(1)
+ #forceref $vItem1 ; to avoid Au3Check warning
-If $g_nComError Then
- MsgBox($MB_SYSTEMMODAL, "AutoItCOM test", "Test passed: We got an error number: 0x" & Hex($g_nComError))
-Else
- MsgBox($MB_SYSTEMMODAL, "AutoItCOM test", "Test failed!")
-EndIf
+ ; chcecking outside Handler if an Error occurred
+ ; REMARK works only if Error Handler is used to set this variable
+ If $g_nComError Then
+ MsgBox($MB_SYSTEMMODAL, "AutoItCOM test", "Test passed: We got an error number: 0x" & Hex($g_nComError))
+ Else
+ MsgBox($MB_SYSTEMMODAL, "AutoItCOM test", "Test failed!")
+ EndIf
-Exit
+EndFunc ;==>Example
-; This is my custom error handler
+; This is custom error handler
Func MyErrFunc()
- Local $HexNumber = Hex($oMyError.number, 8)
+ Local $sHexNumber = Hex($g_oMyError.number, 8)
MsgBox($MB_SYSTEMMODAL, "AutoItCOM Test", "We intercepted a COM Error !" & @CRLF & @CRLF & _
- "err.description is: " & @TAB & $oMyError.description & @CRLF & _
- "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _
- "err.number is: " & @TAB & $HexNumber & @CRLF & _
- "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _
- "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _
- "err.source is: " & @TAB & $oMyError.source & @CRLF & _
- "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _
- "err.helpcontext is: " & @TAB & $oMyError.helpcontext _
+ "err.description is: " & @TAB & $g_oMyError.description & @CRLF & _
+ "err.windescription:" & @TAB & $g_oMyError.windescription & @CRLF & _
+ "err.number is: " & @TAB & $sHexNumber & @CRLF & _
+ "err.lastdllerror is: " & @TAB & $g_oMyError.lastdllerror & @CRLF & _
+ "err.scriptline is: " & @TAB & $g_oMyError.scriptline & @CRLF & _
+ "err.source is: " & @TAB & $g_oMyError.source & @CRLF & _
+ "err.helpfile is: " & @TAB & $g_oMyError.helpfile & @CRLF & _
+ "err.helpcontext is: " & @TAB & $g_oMyError.helpcontext _
)
- $g_nComError = $oMyError.number
+ ; additionaly assign Error number to global variable
+ $g_nComError = $g_oMyError.number
EndFunc ;==>MyErrFunc
Oops, something went wrong.

0 comments on commit 3eb6034

Please sign in to comment.