Article ID: 153309
Article Last Modified on 7/15/2004
Option Explicit
Private Declare Function GetModuleHandle Lib "Kernel" _
(ByVal Module As String) As Integer
Private Declare Function LoadString Lib "user" _
(ByVal hInst As Integer, ByVal wID As Integer, _
ByVal buf As Any, ByVal size As Integer) As Integer
Sub Command1_Click()
Dim ihInst As Integer
Dim sUserName As String * 128
Dim sOrganization As String * 128
Dim sTitle As String
Dim iLength As Integer
ihInst = GetModuleHandle("user.exe")
iLength = LoadString(ihInst, 514, sUserName, Len(sUserName))
sUserName = Left$(sUserName, iLength)
iLength = LoadString(ihInst, 515, sOrganization, Len(sOrganization))
sOrganization = Left$(sOrganization, iLength)
Print sUserName
Print sOrganization
End Sub
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion
145679 : How To Use the Registry API to Save and Retrieve Setting
88363 : Changing Name and Company After Windows Installation
Keywords: kbhowto kbregistry kbapi kb16bitonly KB153309