Results 1 to 8 of 8

Thread: registry

  1. #1

    Thread Starter
    Addicted Member BarankinBeAMan's Avatar
    Join Date
    Aug 2002
    Location
    Reston,Va
    Posts
    164

    registry

    How do I retrieve these settings?

    HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\PageSetup ???

  2. #2
    Hyperactive Member cajsoft's Avatar
    Join Date
    Aug 2000
    Location
    Glasgow, Scotland
    Posts
    295
    Craig Johnstone, MCP,CNA

    VB 6,SQL,Lotus Notes,Crystal Reports 7,8

    http://www.cajsoft.co.uk/downloads.htm

  3. #3
    Lively Member
    Join Date
    Apr 2001
    Location
    SF
    Posts
    93
    Put this code in a module

    Public Function getstring(Hkey As Long, strPath As String, strValue As String)
    'EXAMPLE:
    '
    'text1.text = getstring(HKEY_CURRENT_USE
    ' R, "Software\VBW\Registry", "String")
    '
    Dim keyhand As Long
    Dim datatype As Long
    Dim lResult As Long
    Dim strBuf As String
    Dim lDataBufSize As Long
    Dim intZeroPos As Integer
    r = RegOpenKey(Hkey, strPath, keyhand)
    lResult = RegQueryValueEx(keyhand, strValue, 0&, lValueType, ByVal 0&, lDataBufSize)


    If lValueType = REG_SZ Then
    strBuf = String(lDataBufSize, " ")
    lResult = RegQueryValueEx(keyhand, strValue, 0&, 0&, ByVal strBuf, lDataBufSize)


    If lResult = ERROR_SUCCESS Then
    intZeroPos = InStr(strBuf, Chr$(0))


    If intZeroPos > 0 Then
    getstring = Left$(strBuf, intZeroPos - 1)
    Else
    getstring = strBuf
    End If
    End If
    End If
    End Function



    On the form add a textbox (text1)


    In the form load event add

    Text1.Text = getstring(HKEY_CURRENT_USER, "Software\Microsoft\Internet Explorer\PageSetup", _
    "Footer")

    Techsent

  4. #4

    Thread Starter
    Addicted Member BarankinBeAMan's Avatar
    Join Date
    Aug 2002
    Location
    Reston,Va
    Posts
    164
    Thank ya all,
    it almost works !

  5. #5

    Thread Starter
    Addicted Member BarankinBeAMan's Avatar
    Join Date
    Aug 2002
    Location
    Reston,Va
    Posts
    164
    RegArray = EnumKeyValues(HKEY_CURRENT_USER, "Software\Microsoft\Internet Explorer\PageSetup")

    For intLoop = 0 To UBound(RegArray)
    List1.AddItem RegArray(intLoop)
    Next intLoop

    Text1 = getstring(HKEY_CURRENT_USER, "PageSetup", "Footer")

    Listbox is fine, it shows all the values like footer,header, margins, etc.
    But I cannot retrieve any values to textbox, it is always empty,
    but I know they are not MT in registry !
    How do i read them ??

  6. #6
    Hyperactive Member cajsoft's Avatar
    Join Date
    Aug 2000
    Location
    Glasgow, Scotland
    Posts
    295
    Post all your code for me to have a look at
    Craig Johnstone, MCP,CNA

    VB 6,SQL,Lotus Notes,Crystal Reports 7,8

    http://www.cajsoft.co.uk/downloads.htm

  7. #7

    Thread Starter
    Addicted Member BarankinBeAMan's Avatar
    Join Date
    Aug 2002
    Location
    Reston,Va
    Posts
    164

    all code

    here is the code
    Attached Files Attached Files

  8. #8

    Thread Starter
    Addicted Member BarankinBeAMan's Avatar
    Join Date
    Aug 2002
    Location
    Reston,Va
    Posts
    164

    nevermind

    CAJSOFT,
    please disregard ,
    I got it now:

    MsgBox QueryValue(HKEY_CURRENT_USER, "Software\Microsoft\Internet Explorer\PageSetup", "footer")



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width