I have a winform application that works with/for third party exes. These third party apps do not have any api or command line parameters. Is it possible to control third party apps from winform application using c#.
All I need is:-
- Open third party exe within winform app. Winform will work as a container.
- let the users uses thirdy party apps
- then Exit/End/Close third party exe by winform app.
Any help will be appreciated.
Yes, you can do this for many apps by re-parenting. See here for starters.
I mentioned many apps which implies “not all.” For example, the Windows calculator will give you headaches if you try to switch modes (Standard, Scientific etc.) because each mode change creates a new window. MS Word also has a complex windowing scheme. But things like Notepad and other straightforward apps will work.
So you need to get/start the process, get the process’ window handle and the set the parent to be your application’s window.
Here’s another usful link for getting a process’ window handle.