junkew Posted March 15, 2010 Author Share Posted March 15, 2010 So I should translate it to something like below? What should I then use in the CoCreateInstance call as parameters? Local $tIID_IAccessible = _AutoItObject_CLSIDFromString("{618736E0-3C3D-11CF-810C-00AA00389B71}") Local $pAccessible _AutoItObject_CoCreateInstance(DllStructGetPtr($tIID_IAccessible), 0, 1, DllStructGetPtr(?????????????????????????), $pAccessible) Global $tagIAccessible = "QueryInterface;" & _ "AddRef;" & _ "Release;" & _ ; IUnknown "GetTypeInfoCount;" & _ "GetTypeInfo;" & _ "GetIDsOfNames;" & _ "Invoke;" & _ ; IDispatch "get_accParent;" & _ "get_accChildCount;" & _ "get_accChild;" & _ "get_accName;" & _ "get_accValue;" & _ "get_accDescription;" & _ "get_accRole;" & _ "get_accState;" & _ "get_accHelp;" & _ "get_accHelpTopic;" & _ "get_accKeyboardShortcut;" & _ "get_accFocus;" & _ "get_accSelection;" & _ "get_accDefaultAction;" & _ "accSelect;" & _ "accLocation;" & _ "accNavigate;" & _ "accHitTest;" & _ "accDoDefaultAction;" & _ "put_accName;" & _ "put_accValue;" $oIAccessible = _AutoItObject_WrapperCreate($pIAccessible, $tagIAccessible) FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
trancexx Posted March 15, 2010 Share Posted March 15, 2010 Who told you that? AccessibleObjectFromPoint function will give you pointer for the object you wrapp. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
junkew Posted March 15, 2010 Author Share Posted March 15, 2010 Nobody, just my brain interpreting Object wrapper create based on the suggestion progAndy gave. FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
ProgAndy Posted March 16, 2010 Share Posted March 16, 2010 (edited) You have to use the IAccessible-interface returned from the function IAccessibleFromPoint in the Wrapper-call. (use ptr* instead of idispatch* in the call-declaration) Edit: You also have to find the corect vTable-order of the functions. I don't know whether your order is correct. Edited March 16, 2010 by ProgAndy *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
junkew Posted March 16, 2010 Author Share Posted March 16, 2010 Becomes more difficult then I thought (only final goal is to get the accLocation to work properly)Within the attached code I have the full C VTable/IAccessible interfaceQ1: Not sure anymore if I have correctly wrapped the interface$oIAccessible = _AutoItObject_WrapperCreate($aCall[3], $tagIAccessible) or ;~ $oIAccesible = _AutoItObject_PtrToIDispatch($aCall[3]) ; create IDispatch when no error occuredBefore I wrote (which worked) $tVal = $oIAccesible.accDescription($oChild)And now I write with autoitobject;~ $tVal = $oIAccesible.accDescription("long", "long", $oChild)Q2: How should I write this to get the actual value from accDescription back? Something like $oIAccesible.accName("long", "long", $oChild, "ptr", $tVal) ;~ /* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accName )( ;~ __RPC__in IAccessible * This, ;~ /* [optional][in] */ VARIANT varChild, ;~ /* [retval][out] */ __RPC__deref_out_opt BSTR *pszName);Q3: Should I make the call by using QueryInterface?$oIAccessible.QueryInterface("int", "ptr", Number(DllStructGetPtr(????????????)), "idispatch*", 0)Q4: Should I then use below values?#define DISPID_ACC_PARENT ( -5000 )#define DISPID_ACC_CHILDCOUNT ( -5001 )#define DISPID_ACC_CHILD ( -5002 )#define DISPID_ACC_NAME ( -5003 )#define DISPID_ACC_VALUE ( -5004 )#define DISPID_ACC_DESCRIPTION ( -5005 )#define DISPID_ACC_ROLE ( -5006 )#define DISPID_ACC_STATE ( -5007 )#define DISPID_ACC_HELP ( -5008 )#define DISPID_ACC_HELPTOPIC ( -5009 )#define DISPID_ACC_KEYBOARDSHORTCUT ( -5010 )#define DISPID_ACC_FOCUS ( -5011 )#define DISPID_ACC_SELECTION ( -5012 )#define DISPID_ACC_DEFAULTACTION ( -5013 )#define DISPID_ACC_SELECT ( -5014 )#define DISPID_ACC_LOCATION ( -5015 )#define DISPID_ACC_NAVIGATE ( -5016 )#define DISPID_ACC_HITTEST ( -5017 )#define DISPID_ACC_DODEFAULTACTION ( -5018 )Whole code rewritten with autoitobject library (But not working as I would like to)expandcollapse popup#include <WinAPI.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <StaticConstants.au3> #include <Array.au3> #include "..\AutoItObject_v1.0.0\AutoItObject.au3" Global Const $hOLEACC = DllOpen("oleacc.dll") Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc") Local $tIID_IAccessible = _AutoItObject_CLSIDFromString("{618736E0-3C3D-11CF-810C-00AA00389B71}") ; Start the AutoItObject library _AutoItObject_StartUp() ;~ vtable structure in C ;~ typedef struct IAccessibleVtbl ;~ { ;~ BEGIN_INTERFACE ;~ ;~ HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ;~ __RPC__in IAccessible * This, ;~ /* [in] */ __RPC__in REFIID riid, ;~ /* [annotation][iid_is][out] */ ;~ __RPC__deref_out void **ppvObject); ;~ ;~ ULONG ( STDMETHODCALLTYPE *AddRef )( ;~ __RPC__in IAccessible * This); ;~ ;~ ULONG ( STDMETHODCALLTYPE *Release )( ;~ __RPC__in IAccessible * This); ;~ ;~ HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( ;~ __RPC__in IAccessible * This, ;~ /* [out] */ __RPC__out UINT *pctinfo); ;~ ;~ HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( ;~ __RPC__in IAccessible * This, ;~ /* [in] */ UINT iTInfo, ;~ /* [in] */ LCID lcid, ;~ /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); ;~ ;~ HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( ;~ __RPC__in IAccessible * This, ;~ /* [in] */ __RPC__in REFIID riid, ;~ /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, ;~ /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, ;~ /* [in] */ LCID lcid, ;~ /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); ;~ ;~ /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( ;~ IAccessible * This, ;~ /* [in] */ DISPID dispIdMember, ;~ /* [in] */ REFIID riid, ;~ /* [in] */ LCID lcid, ;~ /* [in] */ WORD wFlags, ;~ /* [out][in] */ DISPPARAMS *pDispParams, ;~ /* [out] */ VARIANT *pVarResult, ;~ /* [out] */ EXCEPINFO *pExcepInfo, ;~ /* [out] */ UINT *puArgErr); ;~ ;~ /* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accParent )( ;~ __RPC__in IAccessible * This, ;~ /* [retval][out] */ __RPC__deref_out_opt IDispatch **ppdispParent); ;~ ;~ /* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accChildCount )( ;~ __RPC__in IAccessible * This, ;~ /* [retval][out] */ __RPC__out long *pcountChildren); ;~ ;~ /* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accChild )( ;~ __RPC__in IAccessible * This, ;~ /* [in] */ VARIANT varChild, ;~ /* [retval][out] */ __RPC__deref_out_opt IDispatch **ppdispChild); ;~ ;~ /* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accName )( ;~ __RPC__in IAccessible * This, ;~ /* [optional][in] */ VARIANT varChild, ;~ /* [retval][out] */ __RPC__deref_out_opt BSTR *pszName); ;~ ;~ /* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accValue )( ;~ __RPC__in IAccessible * This, ;~ /* [optional][in] */ VARIANT varChild, ;~ /* [retval][out] */ __RPC__deref_out_opt BSTR *pszValue); ;~ ;~ /* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accDescription )( ;~ __RPC__in IAccessible * This, ;~ /* [optional][in] */ VARIANT varChild, ;~ /* [retval][out] */ __RPC__deref_out_opt BSTR *pszDescription); ;~ ;~ /* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accRole )( ;~ __RPC__in IAccessible * This, ;~ /* [optional][in] */ VARIANT varChild, ;~ /* [retval][out] */ __RPC__out VARIANT *pvarRole); ;~ ;~ /* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accState )( ;~ __RPC__in IAccessible * This, ;~ /* [optional][in] */ VARIANT varChild, ;~ /* [retval][out] */ __RPC__out VARIANT *pvarState); ;~ ;~ /* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accHelp )( ;~ __RPC__in IAccessible * This, ;~ /* [optional][in] */ VARIANT varChild, ;~ /* [retval][out] */ __RPC__deref_out_opt BSTR *pszHelp); ;~ ;~ /* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accHelpTopic )( ;~ __RPC__in IAccessible * This, ;~ /* [out] */ __RPC__deref_out_opt BSTR *pszHelpFile, ;~ /* [optional][in] */ VARIANT varChild, ;~ /* [retval][out] */ __RPC__out long *pidTopic); ;~ ;~ /* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accKeyboardShortcut )( ;~ __RPC__in IAccessible * This, ;~ /* [optional][in] */ VARIANT varChild, ;~ /* [retval][out] */ __RPC__deref_out_opt BSTR *pszKeyboardShortcut); ;~ ;~ /* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accFocus )( ;~ __RPC__in IAccessible * This, ;~ /* [retval][out] */ __RPC__out VARIANT *pvarChild); ;~ ;~ /* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accSelection )( ;~ __RPC__in IAccessible * This, ;~ /* [retval][out] */ __RPC__out VARIANT *pvarChildren); ;~ ;~ /* [id][propget][hidden] */ HRESULT ( STDMETHODCALLTYPE *get_accDefaultAction )( ;~ __RPC__in IAccessible * This, ;~ /* [optional][in] */ VARIANT varChild, ;~ /* [retval][out] */ __RPC__deref_out_opt BSTR *pszDefaultAction); ;~ ;~ /* [id][hidden] */ HRESULT ( STDMETHODCALLTYPE *accSelect )( ;~ __RPC__in IAccessible * This, ;~ /* [in] */ long flagsSelect, ;~ /* [optional][in] */ VARIANT varChild); ;~ ;~ /* [id][hidden] */ HRESULT ( STDMETHODCALLTYPE *accLocation )( ;~ __RPC__in IAccessible * This, ;~ /* [out] */ __RPC__out long *pxLeft, ;~ /* [out] */ __RPC__out long *pyTop, ;~ /* [out] */ __RPC__out long *pcxWidth, ;~ /* [out] */ __RPC__out long *pcyHeight, ;~ /* [optional][in] */ VARIANT varChild); ;~ ;~ /* [id][hidden] */ HRESULT ( STDMETHODCALLTYPE *accNavigate )( ;~ __RPC__in IAccessible * This, ;~ /* [in] */ long navDir, ;~ /* [optional][in] */ VARIANT varStart, ;~ /* [retval][out] */ __RPC__out VARIANT *pvarEndUpAt); ;~ ;~ /* [id][hidden] */ HRESULT ( STDMETHODCALLTYPE *accHitTest )( ;~ __RPC__in IAccessible * This, ;~ /* [in] */ long xLeft, ;~ /* [in] */ long yTop, ;~ /* [retval][out] */ __RPC__out VARIANT *pvarChild); ;~ ;~ /* [id][hidden] */ HRESULT ( STDMETHODCALLTYPE *accDoDefaultAction )( ;~ __RPC__in IAccessible * This, ;~ /* [optional][in] */ VARIANT varChild); ;~ ;~ /* [id][propput][hidden] */ HRESULT ( STDMETHODCALLTYPE *put_accName )( ;~ __RPC__in IAccessible * This, ;~ /* [optional][in] */ VARIANT varChild, ;~ /* [in] */ __RPC__in BSTR szName); ;~ ;~ /* [id][propput][hidden] */ HRESULT ( STDMETHODCALLTYPE *put_accValue )( ;~ __RPC__in IAccessible * This, ;~ /* [optional][in] */ VARIANT varChild, ;~ /* [in] */ __RPC__in BSTR szValue); ;~ ;~ END_INTERFACE ;~ } IAccessibleVtbl; Global $tagIAccessible = "QueryInterface;" & _ "AddRef;" & _ "Release;" & _ ; IUnknown "GetTypeInfoCount;" & _ "GetTypeInfo;" & _ "GetIDsOfNames;" & _ "Invoke;" & _ ; IDispatch "get_accParent;" & _ "get_accChildCount;" & _ "get_accChild;" & _ "get_accName;" & _ "get_accValue;" & _ "get_accDescription;" & _ "get_accRole;" & _ "get_accState;" & _ "get_accHelp;" & _ "get_accHelpTopic;" & _ "get_accKeyboardShortcut;" & _ "get_accFocus;" & _ "get_accSelection;" & _ "get_accDefaultAction;" & _ "accSelect;" & _ "accLocation;" & _ "accNavigate;" & _ "accHitTest;" & _ "accDoDefaultAction;" & _ "put_accName;" & _ "put_accValue;" ;~ opt("MustDeclareVars", 1) Opt("GUIOnEventMode", 1) Global $tInfo="" Global $myEdit GUICreate("MSAA Spy",600,600,10,10) $myEdit = GUICtrlCreateEdit("First line" & @CRLF, 10, 10, 580, 580, $ES_AUTOVSCROLL + $WS_VSCROLL) GUISetOnEvent(-3, "_Quit") GUISetState() Global $aMousePos, $aCall, $oIAccesible Global $tInfo global $oChild Global $tVar = DllStructCreate($__Au3Obj_tagVARIANT) Global $pVar = DllStructGetPtr($tVar) __Au3Obj_VariantInit($pVar) While 1 $aMousePos = MouseGetPos() $aCall = DllCall($hOLEACC, "int", "AccessibleObjectFromPoint", "int", $aMousePos[0], "int", $aMousePos[1], "ptr*", 0, "ptr", $pVar) If @error Or $aCall[0]<>0 Then ConsoleWrite("!DLLCall-Error or error on receiving IAccesible" & @CRLF) Sleep(500) ContinueLoop EndIf $oIAccessible = _AutoItObject_WrapperCreate($aCall[3], $tagIAccessible) ;~ $oIAccesible = __Au3Obj_ConvertPtrToIDispatch($aCall[3]) ; create IDispatch when no error occured ;~ If IsObj($oIAccesible) Then ; ConsoleWrite("accChild: " & $oAccessibleObject.accChild($Param) & @CRLF) ;<- GUICtrlSetData($myedit, "") ;~ TO DO: Somehow its not an integer like expected ;~ $oChild=$oIAccesible.accchild ;~ $x=int(2+$oChild)-2 dim $array[16] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] if _AutoItObject_VariantRead($pVar)<15 then $oChild=$array[_AutoItObject_VariantRead($pVar)] Else $oChild=0 endif ;~ $oChild=$pVar $tInfo = "Info for child id:" & $oChild & @CRLF ;~ HRESULT get_accChildCount( [out, retval] long *pcountChildren); ;~ $tInfo = $tinfo & "accChildCount: " ;~ $tVal = $oIAccesible.accChildCount($oChild) ;~ $tInfo = $tinfo & $tVal & ";" &@CRLF $tInfo = $tinfo & "accChildCount: " $tVal = $oIAccesible.accChildCount $tInfo = $tinfo & $tVal & ";" &@CRLF $tInfo = $tinfo & "accDefaultAction: " ;~ $tVal = $oIAccesible.accDefaultAction("long", "long", $oChild) $tInfo = $tinfo & $tVal & ";" & @CRLF $tInfo = $tinfo & "accDescription: " ;~ $tVal = $oIAccesible.accDescription($oChild) ;~ $tVal = $oIAccesible.accDescription("long", "long", $oChild) $tInfo = $tinfo & $tVal & ";" & @CRLF ;~ HRESULT get_accFocus( [out, retval] VARIANT *pvarID); ;~ $tInfo = $tinfo & "accFocus: " ;~ $tVal = $oIAccesible.accFocus($oChild) ;~ $tInfo = $tinfo & $tVal & ";" & @CRLF $tInfo = $tinfo & "accFocus: " $tVal = $oIAccesible.accFocus $tInfo = $tinfo & $tVal & ";" & @CRLF $tInfo = $tinfo & "accHelp: " ;~ $tVal = $oIAccesible.accHelp("long", "long", $oChild) $tInfo = $tinfo & $tVal & ";" & @CRLF $tInfo = $tinfo & "accHelpTopic: " ;~ $tVal = $oIAccesible.accHelpTopic("long", "long", $oChild) $tInfo = $tinfo & $tVal & ";" & @CRLF $tInfo = $tinfo & "accKeyboardShortcut: " $tVal = $oIAccesible.accKeyboardShortcut $tInfo = $tinfo & $tVal & ";" & @CRLF $tInfo = $tinfo & "accName: " ;~ $tVal = $oIAccesible.accName("long", "long", $oChild) $tInfo = $tinfo & $tVal & ";" & @CRLF ;~ HRESULT get_accParent( [out, retval] IDispatch **ppdispParent); ;~ $tInfo = $tinfo & "accParent: " ;~ $tVal = $oIAccesible.accParent($oChild) ;~ $tInfo = $tinfo & $tVal & ";" & @CRLF $tInfo = $tinfo & "accParent: " $tVal = $oIAccesible.accParent $tInfo = $tinfo & $tVal & ";" & @CRLF dim $sText ;- Get the textual description of the role $tInfo = $tinfo & "accRole: " ;~ $tVal = $oIAccesible.accRole("long", "long", $oChild) ;~ $tVal = local $aRoleCall = DllCall($hOLEACC, "int", "GetRoleText", "DWORD", $tVal, "str", $sText, "int", 255) $tInfo = $tinfo & $tVal & ":" & $aRoleCall[2] & ";" & @CRLF $tInfo = $tinfo & "accSelection: " ;~ $tVal = $oIAccesible.accSelection("long", "long", $oChild) $tInfo = $tinfo & $tVal & ";" & @CRLF $tInfo = $tinfo & "accState: " ;~ $tVal = $oIAccesible.accState("long", "long", $oChild) $tInfo = $tinfo & $tVal & ";" & @CRLF $tInfo = $tinfo & "accValue: " ;~ $tVal = $oIAccesible.accValue("long", "long", $oChild) $tInfo = $tinfo & $tVal & ";" & @CRLF ;~ All kinds of ways to get the location rectangle $i4Int = DllStructCreate($tagRECT) dim $pX,$pY,$cX,$cY ;~ This should work but doesn't ;~ $oIAccesible.accLocation($px,$py,$cx,$cy,$oChild) ;~ All kinds of workarounds not working ;~ Just to see if something is changed variables initialized dim $p[4]=[1,2,3,4] $px=1 $pY=2 $cX=3 $cY=4 $tInfo = $tinfo & "************************* TO DO Location not working ****************************" & ";" & @crlf $tInfo = $tinfo & "call1" & ";" & @crlf ;~ $aRet1=$oIaccesible.acclocation() $aRet1= "" $oIAccesible.accLocation("long", "long", $p[0], "long", $p[1], "long", $p[2],"long", $p[3], "long", $oChild) $tInfo = $tinfo & "call2" & ";" & @crlf ;~ $aRet2=$oIAccesible.accLocation(DllStructGetPtr($i4Int,1) ,DllStructGetPtr($i4Int,2),DllStructGetPtr($i4Int,3),DllStructGetPtr($i4Int,4),$oChild) ;~ $aRet2=$oIAccesible.accLocation(DllStructGetPtr($i4Int),$oChild) ;~ $tInfo = $tinfo & "call3" & ";" & @crlf ;~ $aRet3=$oIAccesible.accLocation($px ,$py,$cx,$cy,0) $tInfo = $tinfo & $aRet1 & "accLocation 1 : (" & $p[0] & "," & $p[1] & "," & $p[2]& "," & $p[3] & ")" & ";" & @CRLF ;~ $tInfo = $tinfo & $aRet2 & "accLocation 2 : (" & $px & "," & $py & "," & $cx & "," & $cy & ")" & ";" & @CRLF ;~ $tInfo = $tinfo & $aRet3 & "accLocation 3 : " & dllStructGetData($i4Int,1) & dllStructGetData($i4Int,2) & dllStructGetData($i4Int,3) & dllStructGetData($i4Int,4) & ";" & @CRLF GUICtrlSetData($myedit, $tInfo) ;~ Else ;~ ConsoleWrite("! NOT OBJECT" & @CRLF) ;~ EndIf ;~ Do not forget to clean the return result _AutoItObject_VariantClear($aCall[4]) $oIAccesible = 0 ; free Object Sleep(500) WEnd Func MyErrFunc() ;~ ConsoleWrite("!COM Error! " & "Number is: " & Hex($oMyError.number, 8) & " description is: " & $oMyError.windescription & @CRLF) $tInfo=$tInfo & "COM Err #: " & Hex($oMyError.number, 8) & " description: " & $oMyError.windescription ;~ & @CRLF EndFunc ;==>MyErrFunc ; FUNCTIONS: Func _GetObjectWinHandle($oObject) Local $aCall = DllCall("oleacc.dll", "int", "WindowFromAccessibleObject", _ "idispatch", $oObject, _ "hwnd*", 0) If @error Or $aCall[0] Then Return SetError(1, 0, 0) EndIf Return $aCall[2] EndFunc ;==>_GetObjectWinHandle Func _AccessibleObjectFromWindow($hWnd) Local $sIID_IAccessible = "{618736E0-3C3D-11CF-810C-00AA00389B71}" Local $tGUID = _WinAPI_GUIDFromString($sIID_IAccessible) Local $pGUID = DllStructGetPtr($tGUID) Local $aCall = DllCall($hOLEACC, "int", "AccessibleObjectFromWindow", "hwnd", $hWnd, "dword", 0, "ptr", $pGUID, "idispatch*", 0) ; OBJID_WINDOW If @error Or $aCall[0] Then Return SetError(1, 0, 0) EndIf Return $aCall[4] EndFunc ;==>_AccessibleObjectFromWindow Func _AccessibleObjectFromPoint($x,$y) Local $tPoint=DllStructCreate($tagPOINT) dllstructsetdata($tPoint,1,$x) dllstructsetdata($tPoint,2,$y) ;~ STDAPI AccessibleObjectFromWindow( __in HWND hwnd, __in DWORD dwObjectID, __in REFIID riid, __out void **ppvObject); ;~ STDAPI AccessibleObjectFromPoint( __in POINT ptScreen, __out IAccessible **ppacc, __out VARIANT *pvarChild); ;~ local $aCall = DllCall($hOLEACC, "int", "AccessibleObjectFromPoint", "ptr", DllStructGetPtr($tPOINT), "idispatch*", 0, "ptr", 0) ;~ local $aCall = DllCall($hOLEACC, "int", "AccessibleObjectFromPoint", "long", DllStructGetPtr($tPOINT), "idispatch", 0, "ptr", 0) ;~ local $aCall = DllCall($hOLEACC, "int", "AccessibleObjectFromPoint", "int", $x, "int", $y, "idispatch*", 0, "ptr", 0) local $aCall = DllCall($hOLEACC, "int", "AccessibleObjectFromPoint", "int", $x, "int", $y, "ptr*", 0, "ptr", 0) If @error Or $aCall[0] Then Return SetError(1, 0, 0) EndIf return _AutoItObject_WrapperCreate($aCall[3], $tagIAccessible) ;~ Return ConvertPtrToIDispatch($aCall[3]) EndFunc ;==>_AccessibleObjectFromWindow Func _Quit() consolewrite($tinfo) Exit EndFunc ;==>_Quit ; FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now