Two problems

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Taftheman
    New Member
    • Nov 2006
    • 93

    Two problems

    Hi i want to know how to talk to the register so i can find out a value of the windows produt name in VB6.

    My other problem is that for some reason the system info in the about box does not seem to work i always get system unavaliable at this time. I have looked in the code and it is a manual error so i havn't got a clue why it is comming up.

    Can annyone hel;p cheers
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Try to use Savesettings,ge tsettings,delet esetings for handling the registry.

    Comment

    • AHMEDYO
      New Member
      • Nov 2007
      • 112

      #3
      u can use savesetting and deletesetting but i think as i remmember it only will work with ur application setting not all keys in registery, if u wanna work with registry and do what u want u must use API function

      all registry functions start by "Reg" as RegOpenKey, RegCloseKey, RegQueryvalueEx and so on, if u not ordinary work with API u must read about it or u can get external component and i have file that work with registry i was made it before and if u wanna it email me [ mail id removed ]
      Last edited by debasisdas; Nov 15 '07, 12:14 PM. Reason: Removed mail id

      Comment

      • AHMEDYO
        New Member
        • Nov 2007
        • 112

        #4
        Originally posted by debasisdas
        Try to use Savesettings,ge tsettings,delet esetings for handling the registry.
        sry about my mail id , i didnt mean anything except help and this is my first time use forums, sry again

        Comment

        • archdevi
          New Member
          • Feb 2008
          • 1

          #5
          Originally posted by AHMEDYO
          u can use savesetting and deletesetting but i think as i remmember it only will work with ur application setting not all keys in registery, if u wanna work with registry and do what u want u must use API function

          all registry functions start by "Reg" as RegOpenKey, RegCloseKey, RegQueryvalueEx and so on, if u not ordinary work with API u must read about it or u can get external component and i have file that work with registry i was made it before and if u wanna it email me [ mail id removed ]
          Hi there ,

          Can you please help.

          Infact I am trying to read registry keys but unable to do so. I obtained a sample code from the net, however the program is not able to read the registry keys.

          Error msg obtained :"Run MRU list not found"

          however there are values for the key MRUList in the registry.

          Program is as follows:
          [CODE=vb]Public Sub ShowRunMRU()

          Dim iCtr As Integer
          Dim hKey As Long
          Dim nValues As Long, lValueData As Long
          Dim lData As Long
          Dim sPath As String
          Dim sList As String
          Dim sMsg As String
          Dim sData As String
          Dim sName As String
          Dim ft As FILETIME


          sPath = "Software\Micro soft\Windows\Cu rrentVersion\Ex plorer\RunMRU"

          ' Open registry key
          RegOpenKeyEx HKEY_CURRENT_US ER, sPath, 0, KEY_READ, hKey



          ' Collect information on key's values
          If RegQueryInfoKey (hKey, "", 0, 0, 0, 0, 0, nValues, 0, lValueData, _
          0, ft) <> ERROR_SUCCESS Then
          sMsg = "Run MRU list not found"
          Else
          ' initialize data buffer
          lData = lValueData + 1
          sData = Space(lData)
          ' Retrieve MRUList Value
          If RegQueryValueEx (hKey, "MRUList", 0, 0, ByVal sData, lData) <> ERROR_SUCCESS Then
          sMsg = "Run MRU list not found"
          Else
          ' Trim MRU list data
          sList = Left(sData, lData - 1)

          For iCtr = 1 To Len(sList)
          ' Get value name
          sName = Mid(sList, iCtr, 1)
          ' Reinitialize buffer on each iteration
          lData = lValueData + 1
          sData = Space(lData)

          ' Get data
          RegQueryValueEx hKey, sName, 0, 0, ByVal sData, lData

          ' Trim string data
          sData = Left(sData, lData - 1)

          sMsg = sMsg & sData & vbCrLf
          Next
          End If

          RegCloseKey hKey

          End If

          ' Display MRU list
          MsgBox sMsg, vbOKOnly, "Run MRU List"

          End Sub[/CODE]
          Last edited by Killer42; Feb 18 '08, 02:17 AM. Reason: Added CODE=vb tag

          Comment

          • Killer42
            Recognized Expert Expert
            • Oct 2006
            • 8429

            #6
            Originally posted by AHMEDYO
            sry about my mail id , i didnt mean anything except help and this is my first time use forums, sry again
            It's not a major problem. We disallow posting of e-mail addresses ffor your own protection. There are scammers and spammers out there who scan forums like this to harvest addresses.

            Comment

            Working...