Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
AutoHotkey
tree: 28e9e8bb68

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
Lib
Misc
.gitignore
ITL.ahk
ITL_AbstractClassConstructor.ahk
ITL_CoClassConstructor.ahk
ITL_CoClassWrapper.ahk
ITL_ConstantMemberWrapperBaseClass.ahk
ITL_EnumWrapper.ahk
ITL_InterfaceConstructor.ahk
ITL_InterfaceWrapper.ahk
ITL_ModuleWrapper.ahk
ITL_StructureArray.ahk
ITL_StructureConstructor.ahk
ITL_StructureWrapper.ahk
ITL_TypeLibWrapper.ahk
ITL_WrapperBaseClass.ahk
ImportTypeLib.ahk
Main.ahk
Misc.ahk
Properties.ahk
README.md

README.md

ImportTypeLib

This project will allow calling COM object methods by name even on non-dispatch methods by using type information interfaces

Example

Sounds complicated? Here is how it will look:

UIAutomation := ImportTypeLib(A_WinDir "\System32\UIAutomationCore.dll")
automation := new UIAutomation.IUIAutomation(new UIAutomation.CUIAutomation())

list := ""
for field, value in UIAutomation.TreeScope
    list .= "TreeScope." field " = " value "`n"
list .= "`n"
for field, value in UIAutomation.OrientationType
    list .= "OrientationType." field " = " value "`n"
MsgBox % list

desktop := new UIAutomation.IUIAutomationElement(automation.GetRootElement())
MsgBox % "Desktop process PID: " desktop.CurrentProcessId
MsgBox % "Desktop class: " desktop.CurrentClassName

MsgBox % "The desktop has " . (desktop.CurrentOrientation == UIAutomation.OrientationType.Horizontal ? "horizontal" : (desktop.CurrentOrientation == UIAutomation.OrientationType.Vertical ? "vertical" : "no")) . " orientation."

This will work for all COM interfaces for which a "type library" is available (in the example above, it is in %A_WinDir%\System32\UIAutomationCore.dll).

Something went wrong with that request. Please try again.