title image


Smiley Ok, ich probier´s mal....
Hi Mundl,öffne dne VBA-Editor mit Alt+F11 und füge ein neues Modul ein. In dieses Modul kopierst Du folgenen Code:Private Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias "RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As Long, phkResult As Long) As LongPrivate Declare Function RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, lpData As Any, lpcbData As Long) As LongPrivate Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As LongConst REG_SZ = 1Const REG_EXPAND_SZ = 2Const REG_BINARY = 3Const REG_DWORD = 4Const HKEY_CLASSES_ROOT = &H80000000Const HKEY_CURRENT_USER = &H80000001Const HKEY_LOCAL_MACHINE = &H80000002Const HKEY_USERS = &H80000003Const KEY_QUERY_VALUE = &H1Sub Wert_lesen() On Error Resume Next Dim hKey&, RetVal& Dim sWert$ sWert = Space(256) RetVal = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\Microsoft\Windows\CurrentVersion", 0, KEY_QUERY_VALUE, hKey) RetVal = RegQueryValueEx(hKey, "RegisteredOwner", 0, REG_SZ, ByVal sWert, Len(sWert)) RetVal = RegCloseKey(hKey) MsgBox "Toll, Dein Computername lautet: " & sWert, vbInformation, "Registry"End SubDas war´s.Ben

geschrieben von

Login

E-Mail:
  

Passwort:
  

Beitrag anfügen

Symbol:
 
 
 
 
 
 
 
 
 
 
 
 
 

Überschrift: