Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I get a Registry Key Value?
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
How do I get a Registry Key Value?
Miscellaneous
Thread ID:
00529701
Message ID:
00529701
Views:
39
My goal is to get a string telling me who is currently logged on to WindowsNT. I have found a Registry Key (HKEY_LOCAL_MACHINE/Software/Microsoft/Windows NT/CurrentVersion/Winlogon/DefaultUserName) that I believe holds this information.

There might be an easier way but what I have done so far is add the Registry.vcx to my project and copied a registry object to my form. I am attemping to figure out how to use it but there isn't much help available that I've found. It seems I should be using the GetKeyValue method or the GetRegKey method.

I have tried this code:
pUser=thisform.registry1.getkeyvalue('HKEY_LOCAL_MACHINE/ ... /DefaultUserName')

pUser is set to equal -105 so I'm obviously doing something wrong. Could someone please tell me how to set up the registry object to return the UserID or give me an easier way of getting it?

Thanks in advance,
Justin
Next
Reply
Map
View

Click here to load this message in the networking platform