4#include <QtGui/qtguiglobal.h>
5#if QT_CONFIG(accessibility)
9#if defined(__MINGW32__) || defined(__MINGW64__)
11template<
typename T,
typename... TArg>
14 using func_t = T(WINAPI*)(TArg...);
18# pragma GCC diagnostic ignored "-Wcast-function-type"
20 winapi_func(
const char *lib_name,
const char *func_name, func_t func_proto,
21 T error_value = T(__HRESULT_FROM_WIN32(ERROR_PROC_NOT_FOUND))) :
22 func(reinterpret_cast<func_t>(GetProcAddress(LoadLibraryA(lib_name), func_name))),
23 error_value(error_value)
25 std::ignore = func_proto;
28# pragma GCC diagnostic pop
40BOOL WINAPI UiaClientsAreListening()
42 static auto func = winapi_func(
"uiautomationcore", FN(UiaClientsAreListening), BOOL(
false));
46LRESULT WINAPI UiaReturnRawElementProvider(
47 HWND hwnd, WPARAM wParam, LPARAM lParam, IRawElementProviderSimple *
el)
49 static auto func = winapi_func(
"uiautomationcore", FN(UiaReturnRawElementProvider));
50 return func.invoke(hwnd, wParam, lParam,
el);
53HRESULT WINAPI UiaHostProviderFromHwnd(HWND hwnd, IRawElementProviderSimple **ppProvider)
55 static auto func = winapi_func(
"uiautomationcore", FN(UiaHostProviderFromHwnd));
56 return func.invoke(hwnd, ppProvider);
59HRESULT WINAPI UiaRaiseAutomationPropertyChangedEvent(
60 IRawElementProviderSimple *pProvider, PROPERTYID
id, VARIANT oldValue, VARIANT newValue)
62 static auto func = winapi_func(
"uiautomationcore", FN(UiaRaiseAutomationPropertyChangedEvent));
63 return func.invoke(pProvider,
id, oldValue, newValue);
66HRESULT WINAPI UiaRaiseAutomationEvent(IRawElementProviderSimple *pProvider, EVENTID
id)
68 static auto func = winapi_func(
"uiautomationcore", FN(UiaRaiseAutomationEvent));
69 return func.invoke(pProvider,
id);
72HRESULT WINAPI UiaRaiseNotificationEvent(
73 IRawElementProviderSimple *pProvider, NotificationKind notificationKind,
74 NotificationProcessing notificationProcessing, BSTR displayString, BSTR activityId)
76 static auto func = winapi_func(
"uiautomationcore", FN(UiaRaiseNotificationEvent));
77 return func.invoke(pProvider, notificationKind, notificationProcessing, displayString, activityId);