Quantcast
Channel: AutoIt v3 - Developer Chat
Viewing all articles
Browse latest Browse all 750

Analyzing COM objects

$
0
0

Just for the records:
 
MS provides an easy method to retrieve the methods, properties, events of COM objects by uing PowerShell.

  • Open powershell.
  • Create the object. The syntax is:
    $variable = New-object -ComObject "ProgID"
  • Type the variable name to retrieve the properties of the object
  • Use "Get-Member" to retrieve all properties, methods, collections and events of the object

Example: 

$IE = New-object -ComObject "InternetExplorer.Application" $IE $IE|Get-Member
Plain Text         
PS> $object = New-Object -COMObject "InternetExplorer.Application" PS> $object Application          : System.__ComObject Parent               : System.__ComObject Container            : Document             : TopLevelContainer    : True Type                 : Left                 : 309 Top                  : 92 Width                : 1383 Height               : 870 LocationName         : LocationURL          : Busy                 : False Name                 : Windows Internet Explorer HWND                 : 2361028 FullName             : C:\Program Files\Internet Explorer\iexplore.exe Path                 : C:\Program Files\Internet Explorer\ Visible              : False StatusBar            : True StatusText           : ToolBar              : 1 MenuBar              : True FullScreen           : False ReadyState           : 0 Offline              : False Silent               : False RegisterAsBrowser    : False RegisterAsDropTarget : True TheaterMode          : False AddressBar           : True Resizable            : True PS> $object|Get-Member    TypeName: System.__ComObject#{d30c1661-cdaf-11d0-8a3e-00c04fc9e26e} Name                 MemberType Definition ----                 ---------- ---------- ClientToWindow       Method     void ClientToWindow (int, int) ExecWB               Method     void ExecWB (OLECMDID, OLECMDEXECOPT, Variant, Variant) GetProperty          Method     Variant GetProperty (string) GoBack               Method     void GoBack () GoForward            Method     void GoForward () GoHome               Method     void GoHome () GoSearch             Method     void GoSearch () Navigate             Method     void Navigate (string, Variant, Variant, Variant, Variant Navigate2            Method     void Navigate2 (Variant, Variant, Variant, Variant, Varia PutProperty          Method     void PutProperty (string, Variant) QueryStatusWB        Method     OLECMDF QueryStatusWB (OLECMDID) Quit                 Method     void Quit () Refresh              Method     void Refresh () Refresh2             Method     void Refresh2 (Variant) ShowBrowserBar       Method     void ShowBrowserBar (Variant, Variant, Variant) Stop                 Method     void Stop () AddressBar           Property   bool AddressBar () {get} {set} Application          Property   IDispatch Application () {get} Busy                 Property   bool Busy () {get} Container            Property   IDispatch Container () {get} Document             Property   IDispatch Document () {get} FullName             Property   string FullName () {get} FullScreen           Property   bool FullScreen () {get} {set} Height               Property   int Height () {get} {set} HWND                 Property   int64 HWND () {get} Left                 Property   int Left () {get} {set} LocationName         Property   string LocationName () {get} LocationURL          Property   string LocationURL () {get} MenuBar              Property   bool MenuBar () {get} {set} Name                 Property   string Name () {get} Offline              Property   bool Offline () {get} {set} Parent               Property   IDispatch Parent () {get} Path                 Property   string Path () {get} ReadyState           Property   tagREADYSTATE ReadyState () {get} RegisterAsBrowser    Property   bool RegisterAsBrowser () {get} {set} RegisterAsDropTarget Property   bool RegisterAsDropTarget () {get} {set} Resizable            Property   bool Resizable () {get} {set} Silent               Property   bool Silent () {get} {set} StatusBar            Property   bool StatusBar () {get} {set} StatusText           Property   string StatusText () {get} {set} TheaterMode          Property   bool TheaterMode () {get} {set} ToolBar              Property   int ToolBar () {get} {set} Top                  Property   int Top () {get} {set} TopLevelContainer    Property   bool TopLevelContainer () {get} Type                 Property   string Type () {get} Visible              Property   bool Visible () {get} {set} Width                Property   int Width () {get} {set}

Viewing all articles
Browse latest Browse all 750

Trending Articles