RE: Question on Registry in Vista vs Windows XP

Author: Tracy Pearson

Posted: 2009-02-25 at 13:25:18

It might be this:

HKEY_CURRENT_USER\Volatile Environment\UserName

I searched the registry for things, I do not have a reference to say this is

what you are looking for.

As Dave said, SYS(0) or a complicated API call might be what you are looking

for.

GetEnv("UserName") can be dinked with.

When you start VFP with Run As... who the application is running as from

SYS(0), API, and direct Registry read are all the same.

Tracy

-----Original Message-----

From: Jon Westcot

Sent: Wednesday, February 25, 2009 11:45 AM

Hi all:

I've got a question regarding retrieving a value from the Registry

within Vista that I hope someone here can help me answer.

Here's the situation. I've got an existing application that has been

working just fine under Windows XP Pro. At application startup, it queries

the Registry to retrieve the following key value:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Logon

User Name

This value is then used to check in a Security table for a match on the

name. (Yes, I know this is an odd logon situation; it's what the client

wanted.)

The thing is, now they're looking to move to Vista. And, for some

reason, this key value does not exist in Vista.

Can someone point me to a reference of registry keys for Vista? Or can

someone recommend to me a key value I could use that would return the Logon

User Name? Unfortunately, I don't have direct access to Vista, so I can't

just open up the Registry and browse around to find the appropriate key.

Any help you can send my way will be greatly appreciated.

Jon

©2009 Tracy Pearson