Reputation: 413
I would like to make an application by wpf which could overlay a specific windows application. It means, when I run my application and specify Notepad as target application. At that time, anytime Notepad application got focus, my application will take over the focus & prevent user handle directly Notepad.
It is quite simple in case of 2 windows in same application ( we can set owner of child window & showdialog)
So, I wonder that if it is possible to get the handle of window of other application to set owner for our application.
Thanks for any comments or discussion!
Upvotes: 1
Views: 1775
Reputation: 55750
In the general sense, yes - it's possible. But you will have to use Platform APIs in order to obtain the handle of Windows that are not in your process.
Here's a list of Window-related Functions in the Win32 Platform API
You may then by able to make your WPF window appear on top of the other window. But just know that depending on your end goal this might not be the best way to achieve your desired results!
Upvotes: 2