Jump to content

Analyzing COM objects


water
 Share

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_SHOWMINNOACTIVE     Property   int SW_SHOWMINNOACTIVE () {get}
SW_SHOWNA              Property   int SW_SHOWNA () {get}
SW_SHOWNOACTIVATE      Property   int SW_SHOWNOACTIVATE () {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 comment
Share on other sites

Link to comment
Share on other sites

  • Jon unfeatured this topic
  • 4 years later...

@water

$IE = New-object -ComObject "xxxx.xxxxxxxx"
$IE
$IE|Get-Member

Get-Member returning this only not the actual method

1.PNG.bdfc15f1a9b0ea8fe47f21c94e5f6fe6.PNG

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

2.PNG.b4249e73ce7c4d53ea9e1c88a41b346c.PNG

using Autoit ObjName

3.PNG.0cd40c0627255fd585fbe409c6d5296e.PNG

using  @trancexx   TYPELIB Viewer

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

but getting same result

4.PNG.6000dc7a2e64d6b862e07986d3318fa3.PNG

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

Link to comment
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:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

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

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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
 Share

×
×
  • Create New...