locked
UAC Prompt shows up behind other windows RRS feed

  • Question

  • I've written a program that is 90% standard user mode, and 10% needs to be run in elevated mode. I modeled this software after the VBUACSelfElevation sample from the Microsoft All-In-One Code Framework here: http://1code.codeplex.com/wikipage?title=Security

    The sample kicks of a new process using .Net's Diagnostics.Process.Start, using "RunAs" as the verb to start the exe while asking for elevated priveleges.

    This all works fine and dandy, until a certain (unknown to me) UAC setting is applied. On all of my machines, we have UAC set to "prompt for credentials on the secure desktop". However, on one of my networks, when the user is prompted for UAC, you get a pre-prompt with 2 choices. one says "I want to complete this action by entering my credentials on the authentic Windows logon screen", and the other choice is "I don't want to complete this action". Clicking on the first brings up the credentials screen like I am use to on the other machines. I can't figure out which UAC setting is causing this pre-prompt, but that is what is causing me the headaches.

    Problem 1: While this "pre-prompt" is shown, my user interface is still active, and can receive mouse clicks. It is strange that it is able to respond while it is still in the middle of a call to Process.Start. I have been able to work around this by simply disabling my entire form before kicking off the separate process. Kind of gross, but livable.

    Problem 2: This "pre-prompt" is appearing behind all other windows, and the only indication you get is a flashing task bar icon. I need this pre-prompt to appear on top. No combination of AllowSetForegroundWindow or Me.SendToBack, Me.BringToFront is able to fix this.

    Both of these problems can be replicated on Windows 7 using the aforementioned AIO VBUACSelfElevation sample.

    -Ben

     

     

     

     

    Thursday, February 3, 2011 5:18 PM