Source watts on the 15.07.2007 from the MMJ-Quellcodesammlung (Dietmar horn) in The Babyklappe on XProfan.Com stored:
Registry: worth in one Registryschlüssel delete
RegDeleteValue deletes a worth in one Registryschlüssel
L1(Param.1 Longint ): lever one already opened Keys as LongInt or following vordefinierte values =>
HKEY_CLASSES_ROOT = $80000000
HKEY_CURRENT_USER = $80000001
HKEY_LOCAL_MACHINE = $80000002
HKEY_USERS = $80000003
L2(Param.2 Longint ) or B3(Param.3 area ): lever or Memory-Variable with the names the Wertes, the deleted go should.
Declare lever#,Fehler&,Key#,name#,worth#,Size#,Type#,Button&,Button2&
Declare Writewert$,worth2#
Def @Regclosekey(1) !ADVAPI32,RegCloseKey
Def @Regsetvalueex(6) !ADVAPI32,RegSetValueExA
Def @Regcreatekey(3)!ADVAPI32,RegCreateKeyA
Def @Regdeletekey(2) !ADVAPI32,RegDeleteKeyA
Def @Regdeletevalue(2) !ADVAPI32,RegDeleteValueA
Def @Regopenkeyex(5) !ADVAPI32,RegOpenKeyExA
Windowstyle 31
Windowtitle Registryschlüssel create
Window 0,0-640,440
Let Button&=@Createbutton(%Hwnd,Key delete,20,300,200,30)
Let Button2&=@Createbutton(%Hwnd,values delete,320,300,200,30)
Dim Key#,260
Dim lever#,4
Dim name#,250
Dim Size#,4
Dim worth#,260
Dim worth2#,4
Dim Type#,4
String Key#,0=SoftwareMMJ-Test
Let Fehler&=@Regcreatekey($80000001,Key#,lever#)
Print Error Code at create/Öffenen the Schlüssels SoftwareMMJ-Test: ;Fehler&
If Fehler&=0
Let Writewert$=my software
String worth#,0=Softwarepfad
Let Fehler&=@Regsetvalueex(@Long(lever#,0),@Addr(Writewert$),0,1,worth#,@Len(Softwarepfad)+1)
Print Error Code RegSetValueEx Softwarepfad: ;Fehler&
Let Writewert$=serial number
Long worth2#,0=22334
Let Fehler&=@Regsetvalueex(@Long(lever#,0),@Addr(Writewert$),0,4,worth#,4)
Print Error Code RegSetValueEx serial number: ;Fehler&
Let Writewert$=Byteliste
Clear worth#
byte worth#,0=65
byte worth#,1=66
byte worth#,2=67
byte worth#,3=68
Let Fehler&=@Regsetvalueex(@Long(lever#,0),@Addr(Writewert$),0,3,worth#,10)
Print Error Code RegSetValueEx Byteliste: ;Fehler&
Print Error Code RegCloseKey: ;@Regclosekey(@Long(lever#,0))
Endif
Dispose Type#
Dispose worth#
Dispose worth2#
Dispose Key#
Dispose lever#
Dispose name#
Dispose Size#
While 0=0
Waitinput
If @Getfocus(Button&)
Dim Key#,260
Print
String Key#,0=SoftwareMMJ-Test
Let Fehler&=@Regdeletekey($80000001,Key#)
Print Error Code at Delete the Schlüssels SoftwareMMJ-Test: ;Fehler&
Dispose Key#
@Setfocus(%Hwnd)
Elseif @Getfocus(Button2&)
Print
Dim Key#,260
Dim lever#,4
Dim name#,256
String Key#,0=SoftwareMMJ-Test
Let Fehler&=@Regopenkeyex($80000001,Key#,0,$F003f,lever#)
Print Error Code at Öffnen the Schlüssels SoftwareMMJ-Test: ;Fehler&
If Fehler&=0
String name#,0=my software
Let Fehler&=@Regdeletevalue(@Long(lever#,0),name#)
Print Error Code at Delete the Wertes my software: ;Fehler&
String name#,0=serial number
Let Fehler&=@Regdeletevalue(@Long(lever#,0),name#)
Print Error Code at Delete the Wertes serial number: ;Fehler&
String name#,0=Byteliste
Let Fehler&=@Regdeletevalue(@Long(lever#,0),name#)
Print Error Code at Delete the Wertes Byteliste: ;Fehler&
Print Error Code RegCloseKey: ;@Regclosekey(@Long(lever#,0))
Endif
Dispose Key#
Dispose lever#
Dispose name#
@Setfocus(%Hwnd)
Endif
Wend