/ Forside / Teknologi / Udvikling / VB/Basic / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
VB/Basic
#NavnPoint
berpox 2425
pete 1435
CADmageren 1251
gibson 1230
Phylock 887
gandalf 836
AntonV 790
strarup 750
Benjamin... 700
10  tom.kise 610
Hvordan slår man op i Regedit?
Fra : Asbjørn Sloth Tønnes~


Dato : 20-04-01 10:46

Udenfor Visual Basic's område

Asbjørn



 
 
Lord Xevior (20-04-2001)
Kommentar
Fra : Lord Xevior


Dato : 20-04-01 10:57

Tja, der findes da API registry funktioner...... Det er ret besværligt at
lave... Min kode er desværre Copyrightet

Princippet er

open nøgle
hent værdi
luk nøgle

Men her er de funktioner der skal bruges + konstanter

Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long)
As Long
Private Declare Function RegCreateKeyEx Lib "advapi32.dll" Alias
"RegCreateKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal
Reserved As Long, ByVal lpClass As String, ByVal dwOptions As Long, ByVal
samDesired As Long, ByVal lpSecurityAttributes As Long, phkResult As Long,
lpdwDisposition As Long) As Long
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 Long
Private Declare Function RegQueryValueExString 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 Declare Function RegQueryValueExLong Lib "advapi32.dll" Alias
"RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal
lpReserved As Long, lpType As Long, lpData As Long, lpcbData As Long) As
Long
Private Declare Function RegQueryValueExNULL Lib "advapi32.dll" Alias
"RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal
lpReserved As Long, lpType As Long, ByVal lpData As Long, lpcbData As Long)
As Long
Private Declare Function RegSetValueExString Lib "advapi32.dll" Alias
"RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal
Reserved As Long, ByVal dwType As Long, ByVal lpValue As String, ByVal
cbData As Long) As Long
Private Declare Function RegSetValueExLong Lib "advapi32.dll" Alias
"RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal
Reserved As Long, ByVal dwType As Long, lpValue As Long, ByVal cbData As
Long) As Long
Private Declare Function RegEnumKeyEx Lib "advapi32.dll" Alias
"RegEnumKeyExA" (ByVal hKey As Long, ByVal dwIndex As Long, ByVal lpName As
String, lpcbName As Long, ByVal lpReserved As Long, ByVal lpClass As String,
lpcbClass As Long, typLastWriteTime As typFileTime) As Long
Private Declare Function RegEnumValue Lib "advapi32.dll" Alias
"RegEnumValueA" (ByVal hKey As Long, ByVal dwIndex As Long, ByVal
lpValueName As String, lpcbValueName As Long, ByVal lpReserved As Long,
lpType As Long, ByVal lpData As Long, lpcbData As Long) As Long
Private Declare Function RegEnumValueStr Lib "advapi32.dll" Alias
"RegEnumValueA" (ByVal hKey As Long, ByVal dwIndex As Long, ByVal
lpValueName As String, lpcbValueName As Long, ByVal lpReserved As Long,
lpType As Long, ByVal lpData As String, lpcbData As Long) As Long
Private Declare Function RegDeleteKey Lib "advapi32.dll" Alias
"RegDeleteKeyA" (ByVal hKey As Long, ByVal lpSubKey As String) As Long
Private Declare Function RegDeleteValue Lib "advapi32.dll" Alias
"RegDeleteValueA" (ByVal hKey As Long, ByVal lpValueName As String) As Long

Const REG_DWORD As Long = 4
Const REG_OPTION_NON_VOLATILE = 0
Const REG_SZ As Long = 1
Const ERROR_NONE = 0

Const KEY_CREATE_LINK = &H20
Const KEY_CREATE_SUB_KEY = &H4
Const KEY_ENUMERATE_SUB_KEYS = &H8
Const KEY_NOTIFY = &H10
Const KEY_QUERY_vntValue = &H1 'Permission to query subkey data.
Const KEY_READ = KEY_QUERY_vntValue Or KEY_ENUMERATE_SUB_KEYS Or KEY_NOTIFY
Const KEY_SET_vntValue = &H2 'Permission to set subkey data.
Const KEY_WRITE = KEY_SET_vntValue Or KEY_CREATE_SUB_KEY
Const KEY_ALL_ACCESS = KEY_QUERY_vntValue Or KEY_ENUMERATE_SUB_KEYS Or
KEY_NOTIFY Or KEY_CREATE_SUB_KEY Or KEY_CREATE_LINK Or KEY_SET_vntValue

'Define severity codes
Const ERROR_SUCCESS = 0&
Const ERROR_ACCESS_DENIED = 5
Const ERROR_NO_MORE_ITEMS = 259
Const ERROR_MORE_DATA = 234
Const ERROR_INVALID_PARAMETER = 87
Const REG_vntValue_NOT_SET = 2

Private Type typFileTime
lngLowDateTime As Long
lngHighDateTime As Long
End Type

Public Enum enmRootKeys
HKEY_CLASSES_ROOT = &H80000000
HKEY_CURRENT_USER = &H80000001
HKEY_LOCAL_MACHINE = &H80000002
HKEY_USERS = &H80000003
HKEY_CURRENTCONFIG = -1
HKEY_DYNDATA = -1
End Enum



--
Thomas R - MS Developer DK

"Asbjørn Sloth Tønnesen" <Asbjorn@caduceus.dk> wrote in message
news:NBTD6.49805$o4.4025597@news010.worldonline.dk...
Udenfor Visual Basic's område

Asbjørn




Helge Bjørkhaug (20-04-2001)
Kommentar
Fra : Helge Bjørkhaug


Dato : 20-04-01 11:26


"Lord Xevior" <rud_100@hotmail.com> skrev i melding
news:3ae007ca$0$5726$4d4eb98e@news.dk.uu.net...
> Tja, der findes da API registry funktioner...... Det er ret besværligt at
> lave... Min kode er desværre Copyrightet
>
[snip]

Men min følger "Open Source" prinsippet
Et lille eksempel er postet til news:dk.binear

--
Snutten



Asbjørn Sloth Tønnes~ (20-04-2001)
Kommentar
Fra : Asbjørn Sloth Tønnes~


Dato : 20-04-01 14:04

Tak for SaveSetting og GetSetting funktionen

Er der nogen der har en GetAllSettings og/eller Deletesetting funktion?

"Helge Bjørkhaug" <helge@techie.online.no> skrev i en meddelelse news:z8UD6.577$TAb.180118528@news.telia.no...
>
> "Lord Xevior" <rud_100@hotmail.com> skrev i melding
> news:3ae007ca$0$5726$4d4eb98e@news.dk.uu.net...
> > Tja, der findes da API registry funktioner...... Det er ret besværligt at
> > lave... Min kode er desværre Copyrightet
> >
> [snip]
>
> Men min følger "Open Source" prinsippet
> Et lille eksempel er postet til news:dk.binear
>
> --
> Snutten
>
>


Søg
Reklame
Statistik
Spørgsmål : 177551
Tips : 31968
Nyheder : 719565
Indlæg : 6408825
Brugere : 218887

Månedens bedste
Årets bedste
Sidste års bedste