How (if at all possible) to bring the Vista / Win7 UAC consent dialog to the forefront when it is minimized in the taskbar?
For example, consider the following scenario:
My application checks for updates at startup, it downloads a new update file and executes it, providing an administrator password in Process.StartInfo, after which my application closes.
At this point, if the user or Windows manages to lose focus from the MSI installer window (perhaps by clicking on the desktop or in another window), UAC sees that the installer window is not a foreground window and thus causes a blinking dialog agreement on the panel tasks.
Some not so bright clients do not understand that my application has not yet completed the update and will try to restart the application. At this point, I can list the current processes and find the consent file. That blinks on the taskbar.
The problem is that I cannot bring it to the fore. I tried calling ShowWindow () from user32.dll with different parameters (restore, show, normal), but nothing happens. I checked the MainWindowHandle process and it looks normal (it is not zero or negative). I assume the problem is that the UAC is creating another desktop for the consent dialog (secure desktop).
If the user can click the flashing icon on the taskbar to bring the consent dialog to the fore, then can it also be modeled using code?
PS! I am using c #
source share