Jump to content

Analyzing COM objects

Recommended Posts

Messing around with this powershell, seen ...

Cmdlet          Get-AU3Clip                                        AutoItX
Cmdlet          Get-AU3ControlFocus                                AutoItX
Cmdlet          Get-AU3ControlHandle                               AutoItX
Cmdlet          Get-AU3ControlPos                                  AutoItX
Cmdlet          Get-AU3ControlText                                 AutoItX
Cmdlet          Get-AU3ErrorCode                                   AutoItX
Cmdlet          Get-AU3MouseCursor                                 AutoItX
Cmdlet          Get-AU3MousePos                                    AutoItX
Cmdlet          Get-AU3StatusbarText                               AutoItX
Cmdlet          Get-AU3WinCaretPos                                 AutoItX
Cmdlet          Get-AU3WinClassList                                AutoItX
Cmdlet          Get-AU3WinClientSize                               AutoItX
Cmdlet          Get-AU3WinHandle                                   AutoItX
Cmdlet          Get-AU3WinPos                                      AutoItX
Cmdlet          Get-AU3WinProcess                                  AutoItX
Cmdlet          Get-AU3WinState                                    AutoItX
Cmdlet          Get-AU3WinText                                     AutoItX
Cmdlet          Get-AU3WinTitle



How to use them? So far only got Get-AU3MouseCursor to show anything worthwhile.
For example...
Get-AU3MousePos results in...

                                IsEmpty                                       X
                                -------                                       -
                                  False                                     421



I can see that X pos may be at 421, but how do I use these properly?

Crikey! all AutoItX appears to be there.

Cmdlet          Set-AU3Clip                                        AutoItX
Cmdlet          Set-AU3ControlFocus                                AutoItX
Cmdlet          Set-AU3ControlText                                 AutoItX
Cmdlet          Set-AU3Option                                      AutoItX
Cmdlet          Set-AU3WinOnTop                                    AutoItX
Cmdlet          Set-AU3WinState                                    AutoItX
Cmdlet          Set-AU3WinTitle                                    AutoItX
Cmdlet          Set-AU3WinTrans                                    AutoItX
Cmdlet          Invoke-AU3ControlClick                             AutoItX
Cmdlet          Invoke-AU3ControlCommand                           AutoItX
Cmdlet          Invoke-AU3ControlListView                          AutoItX
Cmdlet          Invoke-AU3ControlTreeView                          AutoItX
Cmdlet          Invoke-AU3MouseClick                               AutoItX
Cmdlet          Invoke-AU3MouseClickDrag                           AutoItX
Cmdlet          Invoke-AU3MouseDown                                AutoItX
Cmdlet          Invoke-AU3MouseUp                                  AutoItX
Cmdlet          Invoke-AU3MouseWheel                               AutoItX
Cmdlet          Invoke-AU3Run                                      AutoItX
Cmdlet          Invoke-AU3RunAs                                    AutoItX
Cmdlet          Invoke-AU3RunAsWait                                AutoItX
Cmdlet          Invoke-AU3RunWait                                  AutoItX
Cmdlet          Invoke-AU3Shutdown                                 AutoItX
Cmdlet          Move-AU3Control                                    AutoItX
Cmdlet          Move-AU3Mouse                                      AutoItX
Cmdlet          Move-AU3Win                                        AutoItX
Cmdlet          Send-AU3ControlKey                                 AutoItX
Cmdlet          Send-AU3Key                                        AutoItX
Cmdlet          Show-AU3Control                                    AutoItX
Cmdlet          Show-AU3WinActivate                                AutoItX
Cmdlet          Show-AU3WinMinimizeAll                             AutoItX
Cmdlet          Show-AU3WinMinimizeAllUndo                         AutoItX
Cmdlet          Wait-AU3Win                                        AutoItX
Cmdlet          Wait-AU3WinActive                                  AutoItX
Cmdlet          Wait-AU3WinClose                                   AutoItX
Cmdlet          Wait-AU3WinNotActive                               AutoItX
Cmdlet          Hide-AU3Control                                    AutoItX
Cmdlet          Enable-AU3Control                                  AutoItX
Cmdlet          Disable-AU3Control                                 AutoItX
Cmdlet          Close-AU3Win                                       AutoItX
Cmdlet          Assert-AU3IsAdmin                                  AutoItX
Cmdlet          Assert-AU3WinActive                                AutoItX
Cmdlet          Assert-AU3WinExists                                AutoItX



Ok, think I got ir.

$AU3 = New-object -ComObject "AutoItX3.Control"
$AU3.MouseMove(10, 10, 10)
AutoItSetOption        Method     int AutoItSetOption (string, int)
ClipGet                Method     string ClipGet ()
ClipPut                Method     void ClipPut (string)
ControlClick           Method     int ControlClick (string, string, string, string, int, int, int)
ControlCommand         Method     string ControlCommand (string, string, string, string, string)
ControlDisable         Method     int ControlDisable (string, string, string)
ControlEnable          Method     int ControlEnable (string, string, string)
ControlFocus           Method     int ControlFocus (string, string, string)
ControlGetFocus        Method     string ControlGetFocus (string, string)
ControlGetHandle       Method     string ControlGetHandle (string, string, string)
ControlGetPosHeight    Method     int ControlGetPosHeight (string, string, string)
ControlGetPosWidth     Method     int ControlGetPosWidth (string, string, string)
ControlGetPosX         Method     int ControlGetPosX (string, string, string)
ControlGetPosY         Method     int ControlGetPosY (string, string, string)
ControlGetText         Method     string ControlGetText (string, string, string)
ControlHide            Method     int ControlHide (string, string, string)
ControlListView        Method     string ControlListView (string, string, string, string, string, string)
ControlMove            Method     int ControlMove (string, string, string, int, int, int, int)
ControlSend            Method     int ControlSend (string, string, string, string, int)
ControlSetText         Method     int ControlSetText (string, string, string, string)
ControlShow            Method     int ControlShow (string, string, string)
ControlTreeView        Method     string ControlTreeView (string, string, string, string, string, string)
DriveMapAdd            Method     string DriveMapAdd (string, string, int, string, string)
DriveMapDel            Method     int DriveMapDel (string)
DriveMapGet            Method     string DriveMapGet (string)
Init                   Method     void Init ()
IsAdmin                Method     int IsAdmin ()
MouseClick             Method     int MouseClick (string, int, int, int, int)
MouseClickDrag         Method     int MouseClickDrag (string, int, int, int, int, int)
MouseDown              Method     void MouseDown (string)
MouseGetCursor         Method     int MouseGetCursor ()
MouseGetPosX           Method     int MouseGetPosX ()
MouseGetPosY           Method     int MouseGetPosY ()
MouseMove              Method     int MouseMove (int, int, int)
MouseUp                Method     void MouseUp (string)
MouseWheel             Method     void MouseWheel (string, int)
Opt                    Method     int Opt (string, int)
PixelChecksum          Method     double PixelChecksum (int, int, int, int, int)
PixelGetColor          Method     int PixelGetColor (int, int)
PixelSearch            Method     Variant PixelSearch (int, int, int, int, int, int, int)
ProcessClose           Method     int ProcessClose (string)
ProcessExists          Method     int ProcessExists (string)
ProcessSetPriority     Method     int ProcessSetPriority (string, int)
ProcessWait            Method     int ProcessWait (string, int)
ProcessWaitClose       Method     int ProcessWaitClose (string, int)
Run                    Method     int Run (string, string, int)
RunAs                  Method     int RunAs (string, string, string, int, string, string, int)
RunAsWait              Method     int RunAsWait (string, string, string, int, string, string, int)
RunWait                Method     int RunWait (string, string, int)
Send                   Method     void Send (string, int)
Shutdown               Method     int Shutdown (int)
Sleep                  Method     void Sleep (int)
StatusbarGetText       Method     string StatusbarGetText (string, string, int)
ToolTip                Method     void ToolTip (string, int, int)
WinActivate            Method     void WinActivate (string, string)
WinActive              Method     int WinActive (string, string)
WinClose               Method     int WinClose (string, string)
WinExists              Method     int WinExists (string, string)
WinGetCaretPosX        Method     int WinGetCaretPosX ()
WinGetCaretPosY        Method     int WinGetCaretPosY ()
WinGetClassList        Method     string WinGetClassList (string, string)
WinGetClientSizeHeight Method     int WinGetClientSizeHeight (string, string)
WinGetClientSizeWidth  Method     int WinGetClientSizeWidth (string, string)
WinGetHandle           Method     string WinGetHandle (string, string)
WinGetPosHeight        Method     int WinGetPosHeight (string, string)
WinGetPosWidth         Method     int WinGetPosWidth (string, string)
WinGetPosX             Method     int WinGetPosX (string, string)
WinGetPosY             Method     int WinGetPosY (string, string)
WinGetProcess          Method     string WinGetProcess (string, string)
WinGetState            Method     int WinGetState (string, string)
WinGetText             Method     string WinGetText (string, string)
WinGetTitle            Method     string WinGetTitle (string, string)
WinKill                Method     int WinKill (string, string)
WinList                Method     Variant WinList (string, string)
WinMenuSelectItem      Method     int WinMenuSelectItem (string, string, string, string, string, string, string, str...
WinMinimizeAll         Method     void WinMinimizeAll ()
WinMinimizeAllUndo     Method     void WinMinimizeAllUndo ()
WinMove                Method     int WinMove (string, string, int, int, int, int)
WinSetOnTop            Method     int WinSetOnTop (string, string, int)
WinSetState            Method     int WinSetState (string, string, int)
WinSetTitle            Method     int WinSetTitle (string, string, string)
WinSetTrans            Method     int WinSetTrans (string, string, int)
WinWait                Method     int WinWait (string, string, int)
WinWaitActive          Method     int WinWaitActive (string, string, int)
WinWaitClose           Method     int WinWaitClose (string, string, int)
WinWaitNotActive       Method     int WinWaitNotActive (string, string, int)
error                  Property   int error () {get}
SW_HIDE                Property   int SW_HIDE () {get}
SW_MAXIMIZE            Property   int SW_MAXIMIZE () {get}
SW_MINIMIZE            Property   int SW_MINIMIZE () {get}
SW_RESTORE             Property   int SW_RESTORE () {get}
SW_SHOW                Property   int SW_SHOW () {get}
SW_SHOWDEFAULT         Property   int SW_SHOWDEFAULT () {get}
SW_SHOWMAXIMIZED       Property   int SW_SHOWMAXIMIZED () {get}
SW_SHOWMINIMIZED       Property   int SW_SHOWMINIMIZED () {get}
SW_SHOWNA              Property   int SW_SHOWNA () {get}
SW_SHOWNORMAL          Property   int SW_SHOWNORMAL () {get}
version                Property   string version () {get}



Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to post
Share on other sites
Link to post
Share on other sites
  • Jon unfeatured this topic
  • 4 years later...


$IE = New-object -ComObject "xxxx.xxxxxxxx"

Get-Member returning this only not the actual method


using AutoHotkey getting this

d := ComObjCreate("xxxx.xxxxxxxx")
VarType := ComObjType(d)
IName   := ComObjType(d, "Name")
IID     := ComObjType(d, "IID")
CName   := ComObjType(d, "Class")  ; Requires [v1.1.26+]
CLSID   := ComObjType(d, "CLSID")  ; Requires [v1.1.26+]
MsgBox % "Variant type:`t" VarType
    . "`nInterface name:`t" IName "`nInterface ID:`t" IID
    . "`nClass name:`t" CName "`nClass ID (CLSID):`t" CLSID


using Autoit ObjName


using  @trancexx   TYPELIB Viewer

try with every file in folder (dll,exe,..)

but getting same result


how I can view CLSID, IID & all method with funcation call type......

Link to post
Share on other sites

As neither AutoIt, AutoHotkey nor the Typelib Viewer return a result it seems to be a "problem" with the object.
I'm not very familiar with objects of this kind, so I fear I can't help with this problem 😥

My UDFs and Tutorials:


Active Directory (NEW 2022-02-19 - Version - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version - Download
Outlook Tools (2019-07-22 - Version - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

ADO - Wiki
WebDriver - Wiki


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By DannyJ
      $sCommands1 = 'powershell.exe Get-ChildItem' $iPid = run($sCommands1   , @WorkingDir , @SW_SHOW , 0x2) $sOutput = ""  While 1     $sOutput &= StdoutRead($iPID)         If @error Then             ExitLoop         EndIf  WEnd ;~ msgbox(0, '' , $sOutput) ConsoleWrite("$sOutput") ConsoleWrite($sOutput) ConsoleWrite(@CRLF) $aOutput = stringsplit($sOutput ,@LF , 2) For $i=0 To  UBound($aOutput) - 1 Step 1     ConsoleWrite($aOutput[$i]) Next The script above reads the whole directory into a one dimensional array, but I need to work with the array, so I need to split the array into multiple dimensions.
      I have already read some forum answers here, and I have already tried these commands:
      Are there any way to use the $aOutput variable like in PowerShell:
      $a = Get-ChildItem $a.Mode I imagine this in AutoIt  $aOutput
      ConsoleWrite($aOutput[i].Mode) Or if I split this command into 2 dimension like:
      For $i To UBound($aOutput)-1 Step 1 ConsoleWrite($aOutput[$i][1]) ConsoleWrite($aOutput[$i][2]) Next  
    • By DannyJ
      If I try to run this script with   Get-ChildItem which means dir this script works perfectly, but If I try to run this command Get-RDUserSession, my script has the following error message:
      This command runs perfectly in PowerShell admin and I get back the values
      Get-RDUserSession -ConnectionBroker  broker.local | sort Username Or you can try this command as well
      Get-Command Get-RDUserSession If I run the above mentioned command this runs perfectly in PowerShell but not with AutoIt.
      Here is my script you can test the commands:
      #include<array.au3> $iPid = run('powershell Get-Command Get-RDUserSession'  , @WindowsDir , @SW_HIDE , 0x2) ;; This command not works in AutoIT you can test it in PowerShell but it won't work in Autoit ;$iPid = run('powershell Get-RDUserSession -ConnectionBroker  broker.local | sort Username'  , @WindowsDir , @SW_MAXIMIZE , 0x2) ; This command not works in AutoIT ;$iPid = run('powershell Get-ChildItem | sort Name'  , @WindowsDir , @SW_HIDE , 0x2) ; This runs perfectly $sOutput = ""  While 1     $sOutput &= StdoutRead($iPID)         If @error Then             ExitLoop         EndIf  WEnd ;~ msgbox(0, '' , $sOutput) $aOutput = stringsplit($sOutput , @LF , 2) _ArrayDisplay($aOutput)  
      That could be the solution of the problem if I could run, directly this PowerShell command window and Write to it and save it's values.
    • By DrLarch
      I'm trying to run this powershell command from Autoit and can't figure out how to pull it off:
      Get-ProvisionedAppxPackage -Online | Where-Object { $_.PackageName -match "xbox" } | ForEach-Object { Remove-ProvisionedAppxPackage -Online -AllUsers -PackageName $_.PackageName } I've been trying to run it many different ways including:
      $sCMD = 'Get-ProvisionedAppxPackage -Online | Where-Object { $_.PackageName -match "xbox" } | ForEach-Object { Remove-ProvisionedAppxPackage -Online -AllUsers -PackageName $_.PackageName }' RunWait(@comspec & ' /c powershell.exe -nologo -executionpolicy bypass -noprofile -Command "&' & $sCMD & '"') The problem is that it seems I'm missing something in how to escape or double the quotes. I've tried doubling the quotes in many different ways, but the end result always produces a syntax error in powershell. I could just run powershell first, then paste and run the command, then close the powershell window, but that's clunky. I'm trying to do it either via parameter (as above) or in one line like this:
      RunWait(@comspec & ' /c powershell.exe -nologo -executionpolicy bypass -noprofile -Command "&Get-ProvisionedAppxPackage -Online | Where-Object { $_.PackageName -match "xbox" } | ForEach-Object { Remove-ProvisionedAppxPackage -Online -AllUsers -PackageName $_.PackageName }"')  
    • By antonioj84
      any assistance how to incorporate this powershell command within autoit
      powershell.exe -nologo -executionpolicy bypass -WindowStyle hidden -noprofile -command "&Set-WinUserLanguageList -LanguageList fr-CA, en-CA -Force"
    • By Exit
      For my next project I would like to send files with "alternate data streams" by email in ZIP format.
      I can not use any external program like 7-Zip or WinRAR. (They would fit😥)
      Who knows how to create a ZIP file with "alternate data streams" included with the Powershell command "Compress-Archive"? 
      Here a test script:  (save as "ADSTester.cmd")
      @rem Try to create a zip file with alternate data streams (ADS) included @rem Housekeeping @cls @del ADSTester.zip >nul: @RD /S /Q Extracted >nul: @del ADSTester.txt >nul: @rem End of Housekeeping echo This is the ADSTester.txt file >ADSTester.txt echo This is the ADSTester.txt:Part1 file >ADSTester.txt:Part1 echo This is the ADSTester.txt:Part2 file >ADSTester.txt:Part2 dir /r ADSTester.txt @rem See the 3 files @rem **************************************************************** @rem **************************************************************** @rem Please alter the next lines to include the alternate data streams. powershell Compress-Archive -Path .\ADSTester.txt -Update -DestinationPath ADSTester.zip powershell Expand-Archive -Path ADSTester.zip -DestinationPath .\Extracted\ dir /r Extracted\ADSTester.txt @rem Only one file left :-( pause  
  • Create New...