views:

29

answers:

0

I have a python program that is controlled via a web interface on localhost. This program needs to start applications and bring them to foreground - which is easy (using AttachThreadInput / SetForegroundWindow) until the app in question requires an UAC dialog.

Since I cannot use the AttachThreadInput/SetForegroundWindow trick on the UAC executable, I'm looking for ways of running an app with the foreground priviledge instead of bringing an already existing window to the front.

I tried attaching my program to the foreground thread input before calling subprocess.popen - that unfortunately does not help.

How can I ensure that the UAC dialog and any windows of the started app will be in the foreground?