The WinForms application captures words from mouse position after hotkey (ctrl + mouse right click) is clicked.
Hotkey monitoring runs in third party component.
After hotkey pressed component raises event with clicked controls hwnd argument and mouse position.
How I can find out whether hotkey clicked on the application or not?
It is necessary to know because when the application is hidden by some window from which the word has been captured it will be shown in front and change position if covers the word.
After hotkey handled the third party component raises event with clicked controls hwnd argument and mouse position.
To know the root window of application that contains the control the GetAncestor function can be used: http://msdn.microsoft.com/en-us/library/windows/desktop/ms633502(v=vs.85).aspx
So, to know whether our application has been clicked we can just compare its hwnd and found hwnd.