With Vista you need to use a manifest to either tell Vista to run as invoker,
highestavailable or AsAdministrator.
Preferably an embedded manifest at that, here's a sample:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
Here's some links:
Understanding and Configuring User Account Control in Windows Vista
The Windows Vista and Windows Server 2008 Developer Story: Windows Vista Application Development Requirements
for User Account Control (UAC)
"Toad" <email@example.com> wrote in message news:5OSmj.81543$Lfirstname.lastname@example.org. ..
> A long winded question.
> In Windows XP and 2000, one can write an application that performs a
> ShellExecute with the "runas" verb to launch the Run As dialog box. I
> have extended this to then automate the dialog by clicking the run as
> another use radio button, filling in the user name and the password,
> etc. as dictated by command line options.
> In Vista, the Run As dialog looks completely different and I suspect MS
> has secured the dialog so that it cannot be automated via SendMessage
> calls (let alone that it doesn't look like a traditional dialog). Does
> anyone know if this is true, or can the Vista RunAs dialog be automated
> as in XP and W2K ?
> The reason I ask is that I would like to control the which user is
> selected instead of having to click down the list in the Vista dialog...