#include <Array.au3>
#AutoIt3Wrapper_UseX64=n
Global Const $cINVOKE_ALL = -1 ; All methods/properties
Global Const $cINVOKE_FUNC = 1 ; A method (=function)
Global Const $cINVOKE_PROPERTYGET = 2 ; Read-only property
Global Const $cINVOKE_PROPERTYPUT = 4 ; Read/write property
Global Const $cINVOKE_PROPERTYPUTREF = 8 ; Reference property
$sObj = InputBox('_ObjGetMembers', 'Enter object name:', 'Scripting.FileSystemObject')
If StringStripWS($sObj, 8) == '' Then Exit
$oObj = ObjCreate($sObj)
$aObj_Members = _ObjGetMembers($sObj, 1, $cINVOKE_ALL)
If IsArray($aObj_Members) Then
_ArrayDisplay($aObj_Members)
If UBound($aObj_Members) > 16 Then
;16 should be .GetTempName
ConsoleWrite('$oObj.' & $aObj_Members[16] & ' = ' & Execute("$oObj." & $aObj_Members[16]) & @CRLF)
EndIf
EndIf
ConsoleWrite("_ObjMemberIsValid($sObj, 'NonExsistingMember'): " & _ObjMemberIsValid($sObj, 'NonExsistingMember') & @LF)
Func _ObjGetMembers($sObj, $iRetType = 1, $iInvokeKind = $cINVOKE_ALL)
Local $sCode = ''
$sCode &= 'Function ObjGetMembers(sObj)' & @CRLF
$sCode &= ' Set oObj = CreateObject(sObj)' & @CRLF
$sCode &= ' Set oTLA = CreateObject("TLI.TLIApplication")' & @CRLF
$sCode &= ' Set oMembers = oTLA.InterfaceInfoFromObject(oObj).Members' & @CRLF
$sCode &= ' sMembers = ""' & @CRLF
$sCode &= ' For Each oMember In oMembers' & @CRLF
$sCode &= ' If ' & $iInvokeKind & ' = ' & $cINVOKE_ALL & ' Or oMember.InvokeKind = ' & $iInvokeKind & ' Then' & @CRLF
$sCode &= ' sMembers = sMembers & oMember.Name & vbCRLF' & @CRLF
$sCode &= ' End If' & @CRLF
$sCode &= ' Next' & @CRLF
$sCode &= ' ObjGetMembers = sMembers' & @CRLF
$sCode &= 'End Function' & @CRLF
Local $VbsObj = ObjCreate('ScriptControl')
If @error Then Return SetError(1, 0, -1)
$VbsObj.Language = 'vbscript'
$VbsObj.AddCode($sCode)
Local $sRet = StringStripWS($VbsObj.Run('ObjGetMembers', $sObj), 3)
If Not $sRet Then Return SetError(2, 0, 0)
If $iRetType = 1 Then
Return StringSplit($sRet, @CRLF, 1)
EndIf
Return $sRet
EndFunc
Func _ObjMemberIsValid($sObj, $vMember)
Local $aObj_Members = _ObjGetMembers($sObj)
For $i = 1 To UBound($aObj_Members)-1
If $aObj_Members[$i] = $vMember Then
Return 1
EndIf
Next
Return 0
EndFunc