English
Source / code snippets

Reading Delete Registry Key

 

CompileMarkSeparation
Source wurde am 15.07.2007 aus der MMJ-Quellcodesammlung (Dietmar Horn) in die Babyklappe auf XProfan.Com abgelegt:
Registry: Schlüssel auslesen und löschen
Declare Handle#,FEHLER&,Key#,Name#,Value#,Size#,Type#,Button&,Button2&
Declare WriteValue#,Value2#
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 Registryfunctions
Window 0,0-640,440
Let Button&=@Createbutton(%HWND,Delete Registrykey,20,300,200,30)
Let Button2&=@Createbutton(%HWND,Delete Values,320,300,200,30)
DIM Key#,262
DIM Handle#,4
DIM Name#,252
DIM Size#,4
DIM Value#,260
DIM Value2#,4
Dim Type#,4
Dim WriteValue#,262
String Key#,0=SoftwareAH Test
LET Fehler&=@RegCreateKey($80000001,Key#,Handle#)
Print Errorcode by opening/creating Key SoftwareAH Test: ;Fehler&

IF Fehler&=0

    String WriteValue#,0=My Software
    String Value#,0=Softwarepath
    LET FEHLER&=@RegSetValueEx(@Long(Handle#,0),WriteValue#,0,1,Value#,@len(@string$(Value#,0))+1)
    Print Errorcode RegSetValueEx Softwarepath: ;Fehler&
    string WriteValue#,0=Serialnumber
    Long Value2#,0=22334
    LET FEHLER&=@RegSetValueEx(@Long(Handle#,0),WriteValue#,0,4,Value#,4)
    Print Errorcode RegSetValueEx Serialnumber: ;Fehler&
    string WriteValue#,0=Bytelist
    Clear Value#
    Byte Value#,0=65
    Byte Value#,1=66
    Byte Value#,2=67
    Byte Value#,3=68
    LET FEHLER&=@RegSetValueEx(@Long(Handle#,0),WriteValue#,0,3,Value#,10)
    Print Errorcode RegSetValueEx Bytelist: ;Fehler&
    Print Errorcode RegCloseKey: ;@RegCloseKey(@Long(Handle#,0))

Endif

Dispose Type#
Dispose Value#
Dispose Value2#
Dispose key#
Dispose Handle#
Dispose Name#
Dispose Size#
Dispose WriteValue#

While 1

    Waitinput

    If @Getfocus(Button&)

        DIM Key#,260
        Print
        String Key#,0=SoftwareAH Test
        LET Fehler&=@RegDeleteKey($80000001,Key#)
        Print Fehlercode beim Löschen des Schlüssels SoftwareAH Test: ;Fehler&
        Dispose key#
        @SetFocus(%HWND)

    elseIf @Getfocus(Button2&)

        Print
        DIM Key#,260
        Dim Handle#,4
        Dim Name#,256
        String Key#,0=SoftwareAH Test
        LET FEHLER&=@RegOpenKeyEx($80000001,Key#,0,$F003F,Handle#)
        Print Errorcode by opening Key SoftwareAH Test: ;Fehler&

        IF Fehler&=0

            String Name#,0=My Software
            LET Fehler&=@RegDeleteValue(@Long(Handle#,0),Name#)
            Print Errorcode by deleting the Value Meine Software: ;Fehler&
            String Name#,0=Serialnumber
            LET Fehler&=@RegDeleteValue(@Long(Handle#,0),Name#)
            Print Errorcode by deleting the Value Serialnumber: ;Fehler&
            String Name#,0=Bytelist
            LET Fehler&=@RegDeleteValue(@Long(Handle#,0),Name#)
            Print Errorcode by deleting the Value Bytelist: ;Fehler&
            Print Fehlercode RegCloseKey: ;@RegCloseKey(@Long(Handle#,0))

        endif

        Dispose key#
        Dispose Handle#
        Dispose Name#
        @SetFocus(%HWND)

    endif

wend

 
07/16/07  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

3.204 Views

Untitledvor 0 min.
Georg Teles03/26/23
AndreasS12/02/18
Andre Rohland01/31/18
RudiB.02/08/13
More...

Themeninformationen

this Topic has 1 subscriber:

unbekannt (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie