ComObjGet() [AHK_L 53+]

COM ÄÄÆ÷³ÍÆ®°¡ Á¦°øÇÑ °´Ã¼¸¦ °¡¸®Å°´Â ÂüÁ¶¸¦ µ¹·ÁÁÝ´Ï´Ù.

ComObject := ComObjGet(Name)

¸Å°³º¯¼ö

Name

¿­¶÷ °¡´ÉÇÑ °´Ã¼ÀÇ À̸§. ´õ ÀÚ¼¼ÇÑ Á¤º¸´Â MkParseDisplayName (MSDN)À» ÂüÁ¶ÇϽʽÿÀ.

°ü·Ã Ç׸ñ

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

¿¹Á¦

; ¿¹Á¦: Shift+Escape¸¦ ´©¸£¸é È°¼º âÀÇ ÇÁ·Î¼¼½º¸¦
;   ±âµ¿½ÃÅ°´Â µ¥ »ç¿ëµÈ ¸í·ÉÁÙ À» º¼ ¼ö ÀÖ½À´Ï´Ù.
+Esc::
    WinGet pid, PID, A
    ; WMI ¼­ºñ½º °´Ã¼¸¦ ¾ò½À´Ï´Ù.
    wmi := ComObjGet("winmgmts:")
    ; ÁúÀǸ¦ ½ÇÇàÇØ ºÎÇÕÇÏ´Â ÇÁ·Î¼¼½º(µé)¸¦ ¿­¶÷ÇÕ´Ï´Ù.
    queryEnum := wmi.ExecQuery(""
        . "Select * from Win32_Process where ProcessId=" . pid)
        ._NewEnum()
    ; ù ¹ø°·Î ºÎÇÕÇÏ´Â ÇÁ·Î¼¼½º¸¦ ¾ò½À´Ï´Ù.
    if queryEnum[process]
        MsgBox 0, Command line, % process.CommandLine
    else
        MsgBox Process not found!
    ; ¸ðµç Àü¿ª °´Ã¼¸¦ Ç®¾îÁÝ´Ï´Ù (Áö¿ª º¯¼ö¸¦ »ç¿ëÇÒ ¶§´Â ÇÊ¿äÄ¡ ¾ÊÀ½).
    wmi := queryEnum := process := ""
return
; Win32_Process: http://msdn.microsoft.com/en-us/library/aa394372.aspx