eventlistener-win
所属分类:Pascal/Delphi编程
开发工具:C++
文件大小:0KB
下载次数:0
上传日期:2020-12-18 00:01:43
上 传 者:
sh-1993
说明: 使用UIAutomation.h和Qt-libs创建的Windows事件侦听器
(Windows event listener created with UIAutomation.h and Qt libs)
文件列表:
CMakeLists.txt (574, 2020-12-17)
MonitorableUIAutoEvents.h (1747, 2020-12-17)
focuschangedeventhandler.cpp (5044, 2020-12-17)
focuschangedeventhandler.h (1061, 2020-12-17)
generaleventshandler.cpp (6095, 2020-12-17)
generaleventshandler.h (1248, 2020-12-17)
gitignore (7, 2020-12-17)
main.cpp (1043, 2020-12-17)
wineventlistener.cpp (2093, 2020-12-17)
wineventlistener.h (1593, 2020-12-17)
# Event listener for Windows
**Usage:**
```cpp
#include
#include
#include
#include
#include
int main(int argc, char *argv[])
{
// to receive the event identified by the listener
QVariantMap eventDetected;
/* QList with all events to be identified
* To know all suported events, see:
* https://docs.microsoft.com/en-us/windows/win32/winauto/uiauto-event-ids
*/
QList eventsToIdentify{
"UIA_ToolTipOpenedEventId",
"UIA_ToolTipClosedEventId",
"UIA_AutomationFocusChangedEventId",
"UIA_Window_WindowClosedEventId",
};
/* Create an event listener
you can also limit the listener to specific programs,
like: WinEventListener *listener = new WinEventListener("soffice.bin");
to watch LibreOffice events
*/
WinEventListener *listener = new WinEventListener();
// Add events you want identify
listener->addEventsToIdentify(eventsToIdentify);
// And.. have fun!
listener->listenerStart();
while(true){
if( eventDetected != *listener->eventDetected ){
eventDetected = *listener->eventDetected;
qDebug() << eventDetected;
}
}
}
```
With this library you should be able to capture all Microsoft UIAutomation events present here:
```
https://docs.microsoft.com/en-us/windows/win32/winauto/uiauto-event-ids
```
This readme will be completely written one day.
近期下载者:
相关文件:
收藏者: