Returns a reference to an object provided by a COM component.

ComObject := ComObjGet(Name)



Type: String

The display name of the object to be retrieved. See MkParseDisplayName (MSDN) for more information.

Return Value

Type: Object

This function returns a reference to a COM object.

Error Handling

An exception is thrown on failure.


ComObjCreate, ComObjActive, ComObjConnect, ComObjQuery, CoGetObject (MSDN)


#1: Press Shift+Escape to show the command line which was used to launch the active window's process.

    pid := WinGetPID("A")
    ; Get WMI service object.
    wmi := ComObjGet("winmgmts:")
    ; Run query to retrieve matching process(es).
    queryEnum := wmi.ExecQuery(""
        . "Select * from Win32_Process where ProcessId=" . pid)
    ; Get first matching process.
    if queryEnum[proc]
        MsgBox(proc.CommandLine, "Command line", 0)
        MsgBox("Process not found!")
    ; Free all global objects (not necessary when using local vars).
    wmi := queryEnum := proc := ""
; Win32_Process: