Qt - how to detect what application is in focus
Is it possible to know what applicatio开发者_运维技巧n is in focus using Qt ?
I'm not sure about other apps, but you can tell whether your own application has the focus or not by checking for a 0 result from QApplication::activeWindow.
You'll need to use some Win32 API functions. Mainly GetActiveWindow(). Search MSDN for the function.
精彩评论