Important alert: (current site time 7/16/2013 1:48:11 AM EDT)
 

VB icon

_Get The Registered Owner's Name

Email
Submitted on: 6/25/2002 12:02:29 PM
By: Jaime Muscatelli  
Level: Beginner
User Rating: By 5 Users
Compatibility: VB 5.0, VB 6.0
Views: 22171
author picture
(About the author)
 
     This will enable you to get the registered owner's name of a computer. Similar to the About dialog box in Word, Excel etc. KEYWORDS: Registry User Name About Register Owner
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
				
'**************************************
' Name: _Get The Registered Owner's Name
' Description:This will enable you to get the registered owner's name of a computer. Similar to the About dialog box in Word, Excel etc. KEYWORDS: Registry User Name About Register Owner
' By: Jaime Muscatelli
'
'This code is copyrighted and has' limited warranties.Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=36252&lngWId=1'for details.'**************************************

Private Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Private Declare Function RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, ByVal lpData As String, lpcbData As Long) As Long
Private Const REG_SZ = 1
Private Const LOCALMACHINE = &H80000002
'***** To use this function use Call GETREGOWNERNAME, then use it as a variable. EX - MsgBox GETREGOWNERNAME
Private Function GETREGOWNERNAME() As String
Dim nBufferKey As Long
Dim nBufferName As String
nBufferName = Space(256)
RegOpenKey LOCALMACHINE, "SOFTWARE\Microsoft\Windows\CurrentVersion", nBufferKey
RegQueryValueEx nBufferKey, "RegisteredOwner", 0, REG_SZ, nBufferName, Len(nBufferName)
GETREGOWNERNAME = nBufferName
End Function


Other 17 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
12/8/2002 3:25:05 PMJaime Muscatelli

I recommend you check out my registry tutorial. (Search for 'A great registry tutorial'
(If this comment was disrespectful, please report it.)

 
3/11/2003 7:05:58 AMSaurabh Gupta

For Win NT (2000, XP) the correct key is "SOFTWARE\Microsoft\Windows NT\CurrentVersion"
(If this comment was disrespectful, please report it.)

 
4/5/2003 11:24:44 AMAndrew Munro

wow, all i can say is SWEET.. man this code is awsome i use ir for everything
i dont just use it to find the ownersname ..thnx alot man

(If this comment was disrespectful, please report it.)

 
7/3/2005 3:04:04 AMRde

please close all opened reg keys before using this :)
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.