Sign in to follow this  
Followers 0
daywalkereg

windows vista/7 games folder editor

5 posts in this topic

i'm working on windows vista/7 games folder editor so i can edit existing games but can't add new one because i can't calculate the guid that must be the key name in the registry so any one know how to calculate the GUID by giving it the folder like function called AddGame At msdn but i can't understand c++ so any one plase help me by pointing me to how calulate GUID or how to call that function.

thanks


1 £0\\/3 |-|3® $0 |\\/|µ(|-|

Share this post


Link to post
Share on other sites



daywalkerreg,

Dim $regGames = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\GameUX\Games"

For $i = 1 To _EnumRegKeys2Array($regGames)
    ConsoleWrite(RegEnumKey($regGames, $i) & @CRLF)
Next


Func _EnumRegKeys2Array($sRegKey)
    Local Const $REG_NONE = 0
    Local Const $REG_SZ = 1
    Local Const $REG_EXPAND_SZ = 2
    Local Const $REG_BINARY = 3
    Local Const $REG_DWORD = 4
    Local Const $REG_DWORD_BIG_ENDIAN = 5
    Local Const $REG_LINK = 6
    Local Const $REG_MULTI_SZ = 7
    Local Const $REG_RESOURCE_LIST = 8
    Local Const $REG_FULL_RESOURCE_DESCRIPTOR = 9
    Local Const $REG_RESOURCE_REQUIREMENTS_LIST = 10
    Local Const $REG_QWORD = 11 ; Vista

    Local $aResult[1][3], $aResult_sub, $i, $y
    Local $sRegKey_Name, $sRegKey_Value, $sRegKey_Type

    If StringRight($sRegKey, 1) <> "\" Then $sRegKey = $sRegKey & "\"
    $aResult[0][0] = "0"

    $i = 1
    While 1
        $sRegKey_Name = RegEnumVal($sRegKey, $i)
        If @error Then ExitLoop
        ReDim $aResult[UBound($aResult) + 1][3]
        $aResult[UBound($aResult) - 1][0] = $sRegKey & $sRegKey_Name
        $sRegKey_Value = RegRead($sRegKey, $sRegKey_Name)
        $sRegKey_Type = @extended

        If $sRegKey_Type = $REG_NONE Then $sRegKey_Type = "REG_NONE"
        If $sRegKey_Type = $REG_SZ Then $sRegKey_Type = "REG_SZ"
        If $sRegKey_Type = $REG_EXPAND_SZ Then $sRegKey_Type = "REG_EXPAND_SZ"
        If $sRegKey_Type = $REG_BINARY Then $sRegKey_Type = "REG_BINARY"
        If $sRegKey_Type = $REG_DWORD Then $sRegKey_Type = "REG_DWORD"
        If $sRegKey_Type = $REG_DWORD_BIG_ENDIAN Then $sRegKey_Type = "REG_DWORD_BIG_ENDIAN"
        If $sRegKey_Type = $REG_LINK Then $sRegKey_Type = "REG_LINK"
        If $sRegKey_Type = $REG_MULTI_SZ Then $sRegKey_Type = "REG_MULTI_SZ"
        If $sRegKey_Type = $REG_RESOURCE_LIST Then $sRegKey_Type = "REG_RESOURCE_LIST"
        If $sRegKey_Type = $REG_FULL_RESOURCE_DESCRIPTOR Then $sRegKey_Type = "REG_FULL_RESOURCE_DESCRIPTOR"
        If $sRegKey_Type = $REG_RESOURCE_REQUIREMENTS_LIST Then $sRegKey_Type = "REG_RESOURCE_REQUIREMENTS_LIST"
        If $sRegKey_Type = $REG_QWORD Then $sRegKey_Type = "REG_QWORD" ; Vista

        $aResult[UBound($aResult) - 1][1] = $sRegKey_Value
        $aResult[UBound($aResult) - 1][2] = $sRegKey_Type
        $i += 1
    WEnd

    $i = 1
    While 1
        $sRegKey_Name = RegEnumKey($sRegKey, $i)
        If @error Then ExitLoop
        $aResult_sub = _EnumRegKeys2Array($sRegKey & $sRegKey_Name)
        If UBound($aResult_sub) > 1 Then
            For $y = 1 To UBound($aResult_sub) - 1
                ReDim $aResult[UBound($aResult) + 1][3]
                $aResult[UBound($aResult) - 1][0] = $aResult_sub[$y][0]
                $aResult[UBound($aResult) - 1][1] = $aResult_sub[$y][1]
                $aResult[UBound($aResult) - 1][2] = $aResult_sub[$y][2]
            Next
        EndIf
        $i += 1
    WEnd

    $aResult[0][0] = UBound($aResult) - 1
    Return $aResult

EndFunc   ;==>_EnumRegKeys2Array

_EnumRegKeys2Array() is written by Kafu.

It outputs all of the GUIDs for games (at least on 7).

James

Share this post


Link to post
Share on other sites

daywalkerreg,

Dim $regGames = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\GameUX\Games"

For $i = 1 To _EnumRegKeys2Array($regGames)
    ConsoleWrite(RegEnumKey($regGames, $i) & @CRLF)
Next


Func _EnumRegKeys2Array($sRegKey)
    Local Const $REG_NONE = 0
    Local Const $REG_SZ = 1
    Local Const $REG_EXPAND_SZ = 2
    Local Const $REG_BINARY = 3
    Local Const $REG_DWORD = 4
    Local Const $REG_DWORD_BIG_ENDIAN = 5
    Local Const $REG_LINK = 6
    Local Const $REG_MULTI_SZ = 7
    Local Const $REG_RESOURCE_LIST = 8
    Local Const $REG_FULL_RESOURCE_DESCRIPTOR = 9
    Local Const $REG_RESOURCE_REQUIREMENTS_LIST = 10
    Local Const $REG_QWORD = 11 ; Vista

    Local $aResult[1][3], $aResult_sub, $i, $y
    Local $sRegKey_Name, $sRegKey_Value, $sRegKey_Type

    If StringRight($sRegKey, 1) <> "\" Then $sRegKey = $sRegKey & "\"
    $aResult[0][0] = "0"

    $i = 1
    While 1
        $sRegKey_Name = RegEnumVal($sRegKey, $i)
        If @error Then ExitLoop
        ReDim $aResult[UBound($aResult) + 1][3]
        $aResult[UBound($aResult) - 1][0] = $sRegKey & $sRegKey_Name
        $sRegKey_Value = RegRead($sRegKey, $sRegKey_Name)
        $sRegKey_Type = @extended

        If $sRegKey_Type = $REG_NONE Then $sRegKey_Type = "REG_NONE"
        If $sRegKey_Type = $REG_SZ Then $sRegKey_Type = "REG_SZ"
        If $sRegKey_Type = $REG_EXPAND_SZ Then $sRegKey_Type = "REG_EXPAND_SZ"
        If $sRegKey_Type = $REG_BINARY Then $sRegKey_Type = "REG_BINARY"
        If $sRegKey_Type = $REG_DWORD Then $sRegKey_Type = "REG_DWORD"
        If $sRegKey_Type = $REG_DWORD_BIG_ENDIAN Then $sRegKey_Type = "REG_DWORD_BIG_ENDIAN"
        If $sRegKey_Type = $REG_LINK Then $sRegKey_Type = "REG_LINK"
        If $sRegKey_Type = $REG_MULTI_SZ Then $sRegKey_Type = "REG_MULTI_SZ"
        If $sRegKey_Type = $REG_RESOURCE_LIST Then $sRegKey_Type = "REG_RESOURCE_LIST"
        If $sRegKey_Type = $REG_FULL_RESOURCE_DESCRIPTOR Then $sRegKey_Type = "REG_FULL_RESOURCE_DESCRIPTOR"
        If $sRegKey_Type = $REG_RESOURCE_REQUIREMENTS_LIST Then $sRegKey_Type = "REG_RESOURCE_REQUIREMENTS_LIST"
        If $sRegKey_Type = $REG_QWORD Then $sRegKey_Type = "REG_QWORD" ; Vista

        $aResult[UBound($aResult) - 1][1] = $sRegKey_Value
        $aResult[UBound($aResult) - 1][2] = $sRegKey_Type
        $i += 1
    WEnd

    $i = 1
    While 1
        $sRegKey_Name = RegEnumKey($sRegKey, $i)
        If @error Then ExitLoop
        $aResult_sub = _EnumRegKeys2Array($sRegKey & $sRegKey_Name)
        If UBound($aResult_sub) > 1 Then
            For $y = 1 To UBound($aResult_sub) - 1
                ReDim $aResult[UBound($aResult) + 1][3]
                $aResult[UBound($aResult) - 1][0] = $aResult_sub[$y][0]
                $aResult[UBound($aResult) - 1][1] = $aResult_sub[$y][1]
                $aResult[UBound($aResult) - 1][2] = $aResult_sub[$y][2]
            Next
        EndIf
        $i += 1
    WEnd

    $aResult[0][0] = UBound($aResult) - 1
    Return $aResult

EndFunc   ;==>_EnumRegKeys2Array

_EnumRegKeys2Array() is written by Kafu.

It outputs all of the GUIDs for games (at least on 7).

James

many thanks james ,but i already made the program the only problem is how to add new one

1 £0\\/3 |-|3® $0 |\\/|µ(|-|

Share this post


Link to post
Share on other sites

How does this suit you?

#include <WinAPI.au3>

MsgBox(0x40, "", CoCreateGuid())

Func CoCreateGuid()
    Local $GUID = DllStructCreate($tagGUID)
    $Result = DllCall("OLE32.DLL", "dword", "CoCreateGuid", "ptr", DllStructGetPtr($GUID))
    $Result = _WinAPI_StringFromGUID(DllStructGetPtr($GUID))
    Return $Result
EndFunc   ;==>CoCreateGuid

Share this post


Link to post
Share on other sites

How does this suit you?

#include <WinAPI.au3>

MsgBox(0x40, "", CoCreateGuid())

Func CoCreateGuid()
    Local $GUID = DllStructCreate($tagGUID)
    $Result = DllCall("OLE32.DLL", "dword", "CoCreateGuid", "ptr", DllStructGetPtr($GUID))
    $Result = _WinAPI_StringFromGUID(DllStructGetPtr($GUID))
    Return $Result
EndFunc   ;==>CoCreateGuid

worked like charm :D thankx for your help

1 £0\\/3 |-|3® $0 |\\/|µ(|-|

Share this post


Link to post
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
Sign in to follow this  
Followers 0