返回对 COM 组件提供的对象的引用.
ComObj := ComObjGet(Name)
类型: 字符串
要检索的对象的显示名称. 有关详情, 请参阅 MkParseDisplayName (Microsoft Docs).
类型: ComObject
此函数返回新的 COM 包装对象, 其变体类型为 VT_DISPATCH (9).
失败时抛出异常.
按下 Shift+Esc 来显示活动窗口进程的命令行. 有关 Win32_Process, 请参阅 Microsoft Docs.
+Esc::
{
pid := WinGetPID("A")
; 获取 WMI 服务对象.
wmi := ComObjGet("winmgmts:")
; 执行查询以获取匹配进程.
queryEnum := wmi.ExecQuery(""
. "Select * from Win32_Process where ProcessId=" . pid)
._NewEnum()
; 获取首个匹配进程.
if queryEnum(&proc)
MsgBox(proc.CommandLine, "Command line", 0)
else
MsgBox("Process not found!")
}