Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2007 Jun : Detect Vista Elevated Admin User is Different from Interactive/Login User

www.cryer.info
Managed Newsgroup Archive

Detect Vista Elevated Admin User is Different from Interactive/Login User

Subject:Detect Vista Elevated Admin User is Different from Interactive/Login User
Posted by:"Morgan" (morgan@nospam.att.com)
Date:Tue, 26 Jun 2007 16:35:11

If I run a setup program as a normal user under Vista, it prompts for the
password of an admin user.  Once the password is entered, the setup program
is now elevated and executes as if the user was the admin and the the HKCU
registry key points to the admin's HKCU area, rather than the
interactive/login user's HKCU area.  I'd like to detect this case using the
windows API somehow.  What I want is a function similar to this:

function LoginUserDiffersFromEffectiveUser: Boolean;
begin
   if (EffectiveElevatedUser <> InteractiveLoginUser)
     Result := True
   else
     Result := False;
end;

Replies:

www.cryer.info
Managed Newsgroup Archive