R
rebirth
Unregistered / Unconfirmed
GUEST, unregistred user!
if(S_OK == (hr = AccessibleObjectFromWindow(hWndMainWindow,
OBJID_WINDOW,IID_IAccessible,(void**)&paccMainWindow)))
{
???
}
转换成delphi 该怎么写呢?
参考1:
MSDN 定义 AccessibleObjectFromWindow
The AccessibleObjectFromWindow function retrieves the address of the specified interface to the object associated with the given window.
For more information about COM parameter attributes, allocating memory, and freeing memory, see Definitions of Parameter Attributes.
STDAPI AccessibleObjectFromWindow(
HWND hwnd,
DWORD dwObjectID,
REFIID riid,
void** ppvObject
);
Parameters
hwnd
[in] Specifies the handle of a window for which an object is to be retrieved. To retrieve an interface pointer to the cursor or caret object, specify NULL and use the appropriate object ID in dwObjectID.
dwObjectID
[in] Specifies the object ID. This value is one of the standard object identifier constants or a custom object ID such as OBJID_NATIVEOM, which is the object ID for the Microsoft Office native object model. For more information about OBJID_NATIVEOM, see the Remarks section in this topic.
riid
[in] Specifies the reference identifier of the requested interface. This value is either IID_IAccessible or IID_IDispatch.
ppvObject
[out] Address of a pointer variable that receives the address of the specified interface.
Return Values
If successful, returns S_OK.
If not successful, returns one of the following or another standard COM error code.
该内容在msdn的全文:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msaa/msaaccrf_2r7b.asp
参考文档2:
http://www.richsearch.com/displ.jsp?lid=1432541
OBJID_WINDOW,IID_IAccessible,(void**)&paccMainWindow)))
{
???
}
转换成delphi 该怎么写呢?
参考1:
MSDN 定义 AccessibleObjectFromWindow
The AccessibleObjectFromWindow function retrieves the address of the specified interface to the object associated with the given window.
For more information about COM parameter attributes, allocating memory, and freeing memory, see Definitions of Parameter Attributes.
STDAPI AccessibleObjectFromWindow(
HWND hwnd,
DWORD dwObjectID,
REFIID riid,
void** ppvObject
);
Parameters
hwnd
[in] Specifies the handle of a window for which an object is to be retrieved. To retrieve an interface pointer to the cursor or caret object, specify NULL and use the appropriate object ID in dwObjectID.
dwObjectID
[in] Specifies the object ID. This value is one of the standard object identifier constants or a custom object ID such as OBJID_NATIVEOM, which is the object ID for the Microsoft Office native object model. For more information about OBJID_NATIVEOM, see the Remarks section in this topic.
riid
[in] Specifies the reference identifier of the requested interface. This value is either IID_IAccessible or IID_IDispatch.
ppvObject
[out] Address of a pointer variable that receives the address of the specified interface.
Return Values
If successful, returns S_OK.
If not successful, returns one of the following or another standard COM error code.
该内容在msdn的全文:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msaa/msaaccrf_2r7b.asp
参考文档2:
http://www.richsearch.com/displ.jsp?lid=1432541