Jump to content

RegEnumKey & GUID


Recommended Posts

Hey there everyone! I have problems with built-in function "RegEnumKey". What I'm trying to do is to run registry reader to check every guid of control panel items and put them in listview. Problem is that it just isn't reading all guids. For some odd reason it left unread three guids. In simple words not all registry keys are read and I don't know why. In registry they are but, RegEnumKey just passes without reading them.

Sample of code:

Func _GetInstalledItems()

$i = 0

Do

$i = $i+1

$var = RegEnumKey("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\explorer\ControlPanel\NameSpace\", $i)

If @error <> 0 then $i = -1

$registryvalue = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\explorer\ControlPanel\NameSpace\" & $var, "")

If $registryvalue = "" Then

$registryvalue = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\explorer\ControlPanel\NameSpace\" & $var, "Name")

$var = "<NO GUID USED>"

EndIf

If $var <> "<NO GUID USED>" Then $var = StringLower($var)

If $i <> -1 Then GUICtrlCreateListViewItem("|" & $registryvalue & "|" & $var, $controllist)

Until $i = -1

EndFunc

Link to comment
Share on other sites

Welcome,

Your code reads all 16 keys that my main key has. It seems to work.

GUICreate('', 410, 310)
$controllist = GUICtrlCreateListView('col1|$registryvalue|$var', 5, 5, 400, 300)
_GetInstalledItems()
GUISetState()
Sleep(10000)

Func _GetInstalledItems()
    $i = 0
    Do
        $i = $i + 1
        $var = RegEnumKey("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\explorer\ControlPanel\NameSpace\", $i)
        If @error <> 0 Then $i = -1
        $registryvalue = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\explorer\ControlPanel\NameSpace\" & $var, "")
        If $registryvalue = "" Then
            $registryvalue = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\explorer\ControlPanel\NameSpace\" & $var, "Name")
            $var = "<NO GUID USED>"
        EndIf
        If $var <> "<NO GUID USED>" Then $var = StringLower($var)
        If $i <> -1 Then GUICtrlCreateListViewItem("|" & $registryvalue & "|" & $var, $controllist)
    Until $i = -1
EndFunc   ;==>_GetInstalledItemsoÝ÷ Ù.r¥vÚò¶¬r^jwlyèiØ}êÞÇ¡j^Æ®¶­sduT7&VFRb33²b33²ÂCÂ3¢b33c¶6öçG&öÆÆ7BÒuT7G&Ä7&VFTÆ7EfWrb33¶6öÃÂb33c·&Vv7G'fÇVWÂb33c·f"b33²ÂRÂRÂCÂ3¥ôvWDç7FÆÆVDFV×2¤uT6WE7FFR¥6ÆVW ¤gVæ2ôvWDç7FÆÆVDFV×2 Æö6Âb33c¶Ò vÆR b33c¶³Ò b33c·f"Ò&VtVçVÔ¶WgV÷C´´ÄÒb3#µ4ôeEt$Rb3#´Ö7&÷6ögBb3#µvæF÷w2b3#´7W'&VçEfW'6öâb3#¶WÆ÷&W"b3#´6öçG&öÅæVÂb3#´æÖU76Rb3#²gV÷C²Âb33c¶ bW'&÷"FVâWDÆö÷ b33c·&Vv7G'fÇVRÒ&Vu&VBgV÷C´´ÄÒb3#µ4ôeEt$Rb3#´Ö7&÷6ögBb3#µvæF÷w2b3#´7W'&VçEfW'6öâb3#¶WÆ÷&W"b3#´6öçG&öÅæVÂb3#´æÖU76Rb3#²gV÷C²fײb33c·f"ÂgV÷C²gV÷C² bW'&÷"÷"b33c·&Vv7G'fÇVRÒgV÷C²gV÷C²FVà b33c·&Vv7G'fÇVRÒ&Vu&VBgV÷C´´ÄÒb3#µ4ôeEt$Rb3#´Ö7&÷6ögBb3#µvæF÷w2b3#´7W'&VçEfW'6öâb3#¶WÆ÷&W"b3#´6öçG&öÅæVÂb3#´æÖU76Rb3#²gV÷C²fײb33c·f"ÂgV÷C´æÖRgV÷C² bW'&÷"FVâ6öçFçVTÆö÷ b33c·f"Òb33²fÇC´äòuTBU4TBfwC²b33° VæD` bb33c·f"fÇC²fwC²gV÷C²fÇC´äòuTBU4TBfwC²gV÷C²FVà b33c·f"Ò7G&ætÆ÷vW"b33c·f" VæD` 6öç6öÆUw&FRgV÷C·ÂgV÷C²fײb33c·&Vv7G'fÇVRfײgV÷C·ÂgV÷C²fײb33c·f"fײ5$Äb²FW7B÷WGW@ uT7G&Ä7&VFTÆ7EfWtFVÒgV÷C·ÂgV÷C²fײb33c·&Vv7G'fÇVRfײgV÷C·ÂgV÷C²fײb33c·f"Âb33c¶6öçG&öÆÆ7B tVæ@¤VæDgVæ

but I get same results with both.

:)

Link to comment
Share on other sites

ok, still not all keys... Mystery... Could you please try to put this into to your registry and again check if my code finds new key:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\explorer\ControlPanel\NameSpace\{8965f1d3-4a84-4a5f-812b-51a5270fcf64}]

@="O&O Defrag"

Link to comment
Share on other sites

OK, I've found what problem was causing this... it seems, that Scite isn't happy at all and don't show me all the keys, but if I run script from folder, then everything looks good... BTW: If you compile under x64 with x86 aut2exe it won't gonna show all the keys, but if you compile with x64 - everything looks good... weird... very weird...

Edited by MasterJ
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...