本文整理汇总了C++中DocAccessible::GetNativeInterface方法的典型用法代码示例。如果您正苦于以下问题:C++ DocAccessible::GetNativeInterface方法的具体用法?C++ DocAccessible::GetNativeInterface怎么用?C++ DocAccessible::GetNativeInterface使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DocAccessible
的用法示例。
在下文中一共展示了DocAccessible::GetNativeInterface方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
LRESULT CALLBACK
WindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
// Note, this window's message handling should not invoke any call that
// may result in a cross-process ipc call. Doing so may violate RPC
// message semantics.
switch (msg) {
case WM_GETOBJECT:
{
// Do explicit casting to make it working on 64bit systems (see bug 649236
// for details).
int32_t objId = static_cast<DWORD>(lParam);
if (objId == OBJID_CLIENT) {
DocAccessible* document =
nsWinUtils::sHWNDCache->GetWeak(static_cast<void*>(hWnd));
if (document) {
IAccessible* msaaAccessible = nullptr;
document->GetNativeInterface((void**)&msaaAccessible); // does an addref
if (msaaAccessible) {
LRESULT result = ::LresultFromObject(IID_IAccessible, wParam,
msaaAccessible); // does an addref
msaaAccessible->Release(); // release extra addref
return result;
}
}
}
return 0;
}
case WM_NCHITTEST:
{
LRESULT lRet = ::DefWindowProc(hWnd, msg, wParam, lParam);
if (HTCLIENT == lRet)
lRet = HTTRANSPARENT;
return lRet;
}
}
return ::DefWindowProcW(hWnd, msg, wParam, lParam);
}
示例2: switch
LRESULT CALLBACK
nsAccessNodeWrap::WindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
// Note, this window's message handling should not invoke any call that
// may result in a cross-process ipc call. Doing so may violate RPC
// message semantics.
switch (msg) {
case WM_GETOBJECT:
{
if (lParam == OBJID_CLIENT) {
DocAccessible* document = sHWNDCache.GetWeak(static_cast<void*>(hWnd));
if (document) {
IAccessible* msaaAccessible = NULL;
document->GetNativeInterface((void**)&msaaAccessible); // does an addref
if (msaaAccessible) {
LRESULT result = ::LresultFromObject(IID_IAccessible, wParam,
msaaAccessible); // does an addref
msaaAccessible->Release(); // release extra addref
return result;
}
}
}
return 0;
}
case WM_NCHITTEST:
{
LRESULT lRet = ::DefWindowProc(hWnd, msg, wParam, lParam);
if (HTCLIENT == lRet)
lRet = HTTRANSPARENT;
return lRet;
}
}
return ::DefWindowProcW(hWnd, msg, wParam, lParam);
}