How to detect if an application has UI elements in it from C# in Windows 7?
- by Santhosh
I have a c# application in Windows 7 that runs in Session 0.
This application is basically a framework for software patches installation that will install patches in the background (in session 0).
So this app will download patches from the server and start installing them on the client machines. The way it installs the patches is by calling CreateProcess("Patch.exe").
Now mostly, Patch.exe will be a non-ui silent installation and henceforth, installing the patch from session 0 goes through successfully.
However, sometimes this Patch.exe happens to have some UI elements in it such as prompting the user for some details (like installation location, etc..) and let us say that these UI elements cannot be avoided.
So is it possible for my installation framework (that runs in Session 0 written in C#), to know that the process Patch.exe which was created by my framework has any UI elements in it?
The reason I ask is, if I determine that the application has any UI elements in it, then I do not want to continue with the installation (a crude way of doing this would be to kill the installer process Patch.exe, but that is a different story and not of concern here).