English
Regulars table & Café

RegQueryInfoKey.

 


Description:

RegQueryInfoKey supply erweiterte Information a Registryschlüssel.




Deklaration:

Def @RegQueryInfoKey(12) !ADVAPI32,RegQueryInfoKeyA




Parameter:

1.Parameter: the lever one opened Registryschlüssels, which Info one read wants. The Key must with the Zugriffsrecht KEY_QUERY_VALUE ($1) opened go.
2.Parameter: an enough dimensionierte Memory-Variable, The whom Thread-speed? the Registrykeys aufnimmt (if present). this Parameter can 0 his, if The Info not used becomes.
3.Parameter: address of/ one LongIntvariablen or 4 byte Memory-Variable, The The length of Parameter 2 in Bytes contains. Kehrt The function back, standing here The to Parameter 2 copied amount on Bytes. this Parameter can 0 his, if the 2.Parameter 0 is.
4.Parameter: reserved, must 0 his.
5.Parameter: address of/ one LongIntvariablen or 4 byte Memory-Variable, The The Number of Unterschlüssel aufnimmt. can 0 his, if The Info not needed becomes.
6.Parameter: address of/ one LongIntvariablen or 4 byte Memory-Variable, The The Size the longest Unterschlüssels aufnimmt. can 0 his, if The Info not needed becomes.
7.Parameter: address of/ one LongIntvariablen or 4 byte Memory-Variable, The The length the longest Unterschlüssel-Klassennamens aufnimmt. can 0 his, if The Info not needed becomes.
8.Parameter: address of/ one LongIntvariablen or 4 byte Memory-Variable, The The Number of values in the Key aufnimmt. can 0 his, if The Info not needed becomes.
9.Parameter: address of/ one LongIntvariablen or 4 byte Memory-Variable, The The length the longest Wertenamens aufnimmt. can 0 his, if The Info not needed becomes.
10.Parameter: address of/ one LongIntvariablen or 4 byte Memory-Variable, The The length the longest Wertes aufnimmt. can 0 his, if The Info not needed becomes.
11.Parameter: address of/ one LongIntvariablen or 4 byte Memory-Variable, The The length the Security Descriptors the Schlüssels aufnimmt. can 0 his, if The Info not needed becomes.
12.Parameter: FILETIME Structure or 8 byte Memory-Variable, The The Time the last Schreibens into Key aufnimmt. calculated becomes The Time ex the 01.01.1601 in 100 Nanosekunden.



Return Value:

0 with success, with Error one Errorcode.


Examples:

CompileMarkSeparation
Def @RegOpenKeyEx(5) !"ADVAPI32","RegOpenKeyExA"
Def @RegEnumKey(4) !"ADVAPI32","RegEnumKeyA"
Def @RegCloseKey(1) !"ADVAPI32","RegCloseKey"
Def @InitCommonControls(0) !"COMCTL32","InitCommonControls"
Def @RegQueryInfoKey(12) !"ADVAPI32","RegQueryInfoKeyA"
DEF @GetSysColor(1) !"USER32","GetSysColor"
@InitCommonControls()
Declare CLASS#,ClassSize&,SubKeys&,Greatest&,MaxClassLen&
Declare Values&,MaxValueNameLen&,MaxValueLen&,SecDescLänge&,FileTime#
Declare Fehler&,CL_NAME&
Declare hImageList&,hIcon&,Executehandle&,Root1&,ROOT&[2,3,10],ROOT11&
Declare Imagelist&,TV_INSERT#,TV_TEXT#,TV_ITEM#,REG_KEY$,REG_ROOT$,REG_ERGEBNIS$
Declare Unterlage7&,TV_ITEM_HANDLE&,TV_ITEM_HANDLE2&
Declare REG_ERGEBNIS#,REG_ERROR&,REG_HANDLE&
Declare REG_Zähler%,TV_ITEM_HANDLE1&
Declare CL_Länge&,SK_ANZAHL&,SK_Länge&,CL_LängeMax&,W_Anzahl&
Declare WN_Länge&,W_Länge&,SecDesc_Länge&
Dim TV_TEXT#,261
DIM REG_ERGEBNIS#,261
Declare TreeView&
DIM TV_INSERT#,48
DIM TV_ITEM#,40

PROC TVINSERT

    String TV_TEXT#,0=@$(2)      Der Text im Label
    long TV_INSERT#,0=@&(1)          TVins-Parent
    long TV_INSERT#,8=$0001
    long TV_INSERT#,24=TV_TEXT#   Adress of Label

ENDPROC

Windowstyle 31+512
Window 10,50-600,420
Windowtitle "Infos über Registrykeys auslesen"
settruecolor 1
cls @GETSYSCOLOR(15)
LET Unterlage7&=@Control("Dialog","",$40000000+$10000000,10,50,600,320,%HWND,3,%HINSTANCE)
Let TreeView&=@control("SysTreeView32","",$40000000+$10000000+$800000+$200000+$0002+$0010+$0020,40,20,250,300,Unterlage7&,200,%Hinstance)
@sendmessage(TreeView&,$1109,0,Imagelist&) Associate the image list with the tree
LET CL_NAME&=@Createtext(%HWND,"Klassenname=",310,50,400,30)
LET CL_Länge&=@Createtext(%HWND,"Länge des Klassennamens=",310,85,400,30)
LET SK_ANZAHL&=@Createtext(%HWND,"Anzahl der Unterschlüssel=",310,190,400,30)
LET SK_LÄNGE&=@Createtext(%HWND,"Läng des größten Unterschlüssels=",310,155,400,30)
LET CL_LängeMax&=@Createtext(%HWND,"Länge des längsten Klassennamens=",310,120,400,30)
LET W_Anzahl&=@Createtext(%HWND,"Anzahl der Werte im Schlüssel=",310,225,400,30)
LET WN_Länge&=@Createtext(%HWND,"Länge des größten Wertenamens=",310,260,400,30)
LET W_Länge&=@Createtext(%HWND,"Länge des größten Wertes=",310,295,400,30)
LET SecDesc_Länge&=@Createtext(%HWND,"Länge des Security Descriptors=",310,330,400,30)
@Sendmessage(Treeview&,$111D,0,@RGB(255,255,220))
@Sendmessage(Treeview&,$111E,0,@RGB(255,70,100))
TVINSERT 0,"HKEY_LOCAL_MACHINE",$0010
@sendmessage(Treeview&,$1100,0,TV_INSERT#)
TVINSERT 0,"HKEY_USERS",$0010
@sendmessage(Treeview&,$1100,0,TV_INSERT#)
CLEAR TV_ITEM#,TV_TEXT#

While %MENUITEM<>-2

    Sleep 100
    LET TV_ITEM_HANDLE1&=@sendmessage(Treeview&,$110A,$0009,0)

    IF TV_ITEM_HANDLE1&<>TV_ITEM_HANDLE&

        Enablewindow Treeview&,0
        Usecursor 2
        LET REG_KEY$=""
        LET REG_ROOT$=""
        LET TV_ITEM_HANDLE&=TV_ITEM_HANDLE1&
        CLEAR TV_ITEM#,TV_TEXT#
        LONG TV_ITEM#,0=$11
        LONG TV_ITEM#,20=261
        LONG TV_ITEM#,16=TV_TEXT#
        LONG TV_ITEM#,4=TV_ITEM_HANDLE&
        @sendmessage(Treeview&,$110C,0,TV_ITEM#)
        LET REG_KEY$=@STRING$(TV_TEXT#,0)
        LET TV_ITEM_HANDLE2&=TV_ITEM_HANDLE&

        While TV_ITEM_HANDLE2&<>0

            LET TV_ITEM_HANDLE2&=@sendmessage(Treeview&,$110A,$3,TV_ITEM_HANDLE2&)

            IF TV_ITEM_HANDLE2&<>0

                CLEAR TV_ITEM#,TV_TEXT#
                LONG TV_ITEM#,0=$11
                LONG TV_ITEM#,20=261
                LONG TV_ITEM#,16=TV_TEXT#
                LONG TV_ITEM#,4=TV_ITEM_HANDLE2&
                @sendmessage(Treeview&,$110C,0,TV_ITEM#)
                LET REG_KEY$=""+REG_KEY$
                LET REG_KEY$=@STRING$(TV_TEXT#,0)+REG_KEY$

            endif

        wend

        LET REG_ROOT$=@SubStr$(REG_KEY$,1,"")

        IF REG_ROOT$<>""

            LET REG_KEY$=@TRANSLATE$(REG_KEY$,REG_ROOT$,"")
            CASE LEFT$(REG_KEY$,1)="" : LET REG_KEY$=@RIGHT$(REG_KEY$,@LEN(REG_KEY$)-1)

        else

            LET REG_ROOT$=REG_KEY$
            LET REG_KEY$=""

        endif

        While @sendmessage(Treeview&,$110A,$4,TV_ITEM_HANDLE&)<>0

            LET TV_ITEM_HANDLE2&=@sendmessage(Treeview&,$110A,$4,TV_ITEM_HANDLE&)
            @Sendmessage(Treeview&,$1101,0,TV_ITEM_HANDLE2&)

        wend

        IF REG_ROOT$="HKEY_USERS"

            LET REG_Error&=@RegOpenKeyEx($80000003,@addr(REG_Key$),0,$20019,@addr(REG_Handle&))

        Elseif REG_ROOT$="HKEY_LOCAL_MACHINE"

            LET REG_Error&=@RegOpenKeyEx($80000002,@addr(REG_Key$),0,$20019,@addr(REG_Handle&))

        else

            LET REG_Error&=2

        endif

        LET REG_ZÄHLER%=0

        whilenot REG_Error&

            LET REG_Error&=@RegEnumKey(REG_Handle&,REG_Zähler%,REG_Ergebnis#,261)

            IF REG_Error&=0

                LET REG_ERGEBNIS$=@string$(REG_Ergebnis#,0)
                TVINSERT TV_ITEM_HANDLE&,REG_ERGEBNIS$,$0010
                @sendmessage(Treeview&,$1100,0,TV_INSERT#)

            endif

            inc REG_Zähler%

        wend

        Dim Class#,261
        DIM FileTime#,8
        LET ClassSize&=261
        Let Fehler&=@RegQueryInfoKey(REG_Handle&,Class#,@ADDR(ClassSize&),0,@ADDR(SubKeys&),@ADDR(Greatest&),@ADDR(MaxClassLen&),@ADDR(Values&),@ADDR(MaxValueNameLen&),@ADDR(MaxValueLen&),@ADDR(SecDescLänge&),FileTime#)
        Settext CL_NAME&,"Klassenname="+@String$(CLASS#,0)
        Settext CL_Länge&,"Länge des Klassennamens="+@STR$(ClassSize&)
        Settext SK_ANZAHL&,"Anzahl der Unterschlüssel="+@STR$(SubKeys&)
        Settext SK_Länge&,"Länge des größten Unterschlüssels="+@STR$(Greatest&)
        Settext CL_LängeMax&,"Länge des größten Klassennamens="+@STR$(MaxClassLen&)
        Settext W_Anzahl&,"Anzahl der Werte im Schlüssel="+@STR$(Values&)
        Settext WN_Länge&,"Länge des größten Wertenamens="+@STR$(MaxValueNameLen&)
        Settext W_Länge&,"Länge des größten Wertes="+@STR$(MaxValueLen&)
        Settext SecDesc_Länge&,"Länge des Security Descriptors="+@STR$(SecDescLänge&)
        Dispose FileTime#
        Dispose CLASS#
        @RegCloseKey(REG_Handle&)
        @Sendmessage(Treeview&,$1113,0,TV_ITEM_HANDLE&)
        Usecursor 0
        Enablewindow Treeview&,1

    endif

    DRAWTEXT 0,0,"REG_ROOT$="+REG_ROOT$+@SPACE$(255)
    DRAWTEXT 0,20,"REG_KEY$="+REG_KEY$+@SPACE$(255)

WEND

Dispose TV_ITEM#
Dispose TV_TE
class=s4 href='./../../Function-References/XProfan/dispose/'>DISPOSE TV_INSERT# Dispose REG_ERGEBNIS#

[keywords:c4a25e952a]
Klassenname Key Key Registry Unterschlüssel amount Size größter length worth values name letters Bytes
[/keywords:c4a25e952a]
 
07/02/05  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

1.588 Views

Untitledvor 0 min.
Christian Hahn06/26/13
Manfred Barei01/21/12
E.T.02/19/11

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