Reputation: 7447
I want my application to capture input focus, whenever the mouse hovers over it. How do I do it in Windows?
Basically I dont want users to explicitly click on the application, or the taskbar icon before entering any text, when the application is not in foreground.
I tried the SetForegroundWindow
API in the mouse hover notification, but that just flashes the icon in the taskbar.
Any suggestions?
Upvotes: 0
Views: 768
Reputation: 55
There are 3 ways you can make your window Active
Upvotes: 0
Reputation: 941545
Not sure where the focus is supposed to go. But if to the hovered window then fake a mouse click with SendInput().
Upvotes: 1
Reputation: 3564
Try GetDlgItem(QTIDD_W01_0)->SetFocus(); //QTIDD_W01_0 is the window of the screen
Upvotes: 0