Searching for a registry entry

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ali Rizwan
    Banned
    Contributor
    • Aug 2007
    • 931

    Searching for a registry entry

    hi,
    how can i search for a registery?
  • hariharanmca
    Top Contributor
    • Dec 2006
    • 1977

    #2
    Originally posted by Ali Rizwan
    hi,
    how can i search for a registery?
    Explain your problem detail.

    Comment

    • Ali Rizwan
      Banned
      Contributor
      • Aug 2007
      • 931

      #3
      Originally posted by hariharanmca
      Explain your problem detail.
      OK
      I want to make a tweak and want to search for any registery.
      Also want how to read and write any registery.
      Like Password, Username, Volume settings etc
      THANKS
      ALI

      Comment

      • hariharanmca
        Top Contributor
        • Dec 2006
        • 1977

        #4
        To search

        Run Application at windows logon

        In the above link
        [CODE=vb]
        'Check For key
        If Not regKey.GetKeyVa lue(HKEY_LOCAL_ MACHINE, strKeyRootPath, strKeyValueHere , strMyExePathAnd Name) Then[/CODE]


        To get the current username. Use

        [CODE=vb]Private Declare Function GetUserName Lib "advapi32.d ll" Alias "GetUserNam eA" (ByVal buffer As String, buffersize As Long) As Long

        'To Call above method.....
        GetUserName buff, 128
        txtUserName.Tex t = buff[/CODE]

        Comment

        • Ali Rizwan
          Banned
          Contributor
          • Aug 2007
          • 931

          #5
          Originally posted by hariharanmca
          To search

          Run Application at windows logon

          In the above link
          [CODE=vb]
          'Check For key
          If Not regKey.GetKeyVa lue(HKEY_LOCAL_ MACHINE, strKeyRootPath, strKeyValueHere , strMyExePathAnd Name) Then[/CODE]


          To get the current username. Use

          [CODE=vb]Private Declare Function GetUserName Lib "advapi32.d ll" Alias "GetUserNam eA" (ByVal buffer As String, buffersize As Long) As Long

          'To Call above method.....
          GetUserName buff, 128
          txtUserName.Tex t = buff[/CODE]
          Thanks a lot Hari
          But how can i change it (writing registery)?
          Thanx

          Comment

          • hariharanmca
            Top Contributor
            • Dec 2006
            • 1977

            #6
            Originally posted by Ali Rizwan
            Thanks a lot Hari
            But how can i change it (writing registery)?
            Thanx
            I replied there This methods will just find for the key and update the key.
            [CODE=vb]
            'find for the key
            If Not regKey.GetKeyVa lue(HKEY_LOCAL_ MACHINE, strKeyRootPath, strKeyValueHere , strMyExePathAnd Name) Then[/CODE]
            [CODE=vb]
            'update the key
            regKey.UpdateKe y HKEY_LOCAL_MACH INE, strKeyRootPath, strKeyValueHere , strMyExePathAnd Name[/CODE]

            Comment

            • hariharanmca
              Top Contributor
              • Dec 2006
              • 1977

              #7
              The below method is used to Get and set Key values.

              [CODE=vb]
              'Get Key value
              strCurKeyValue = GetSetting(strA pplicationName, strSection, strKeyName, strDefaultSetti ngValue)
              'Set Key Value
              SaveSetting strApplicationN ame, strSection, strKeyName, strDefaultSetti ngValue
              [/CODE]

              Comment

              • Ali Rizwan
                Banned
                Contributor
                • Aug 2007
                • 931

                #8
                Originally posted by hariharanmca
                The below method is used to Get and set Key values.

                [CODE=vb]
                'Get Key value
                strCurKeyValue = GetSetting(strA pplicationName, strSection, strKeyName, strDefaultSetti ngValue)
                'Set Key Value
                SaveSetting strApplicationN ame, strSection, strKeyName, strDefaultSetti ngValue
                [/CODE]
                Thanks a lot Hari
                Thanks

                Comment

                Working...