Visual Basic/VB >> Registry Entries

by Tom Esh » Tue, 07 Oct 2003 07:44:14 GMT

On Mon, 6 Oct 2003 18:08:38 -0400, "Slug" < XXXX@XXXXX.COM > wrote:

>Can I save entries to the HKey_Local_Machine\Software instead of only to the
>HKey_Current_User\Software? From what I can tell you cant do this using
>SaveSettings().

Correct. You'll need to use the Api to read/write to other reg areas.
There are plenty of examples and free class wrappers / components
available for this. One (with source) is at:
http://vbaccelerator.com/home/index.asp

Keep in mind that on NT/XP systems, users typically do not have write
permission for HKLM.


-Tom
MVP - Visual Basic
(please post replies to the newsgroup)


Similar Threads

1. Read Registry Entry with VB 6.0 and RAPI

I have been scouring the newsgroups and Microsoft's website and have
not come across a simple example of reading a value from the registry
on the PocketPC.  I have created the following procedure...

    Dim iretval As Long
    Dim lngResult As Long
    Dim lngKeyPointer As Long
    Dim lpData(1000) As Byte
    Dim lpType As Long
    Dim lpcbData As Long
    Dim key As String
    Dim subKey As String
    Dim lpValue As Long

    Dim Value As String
    iretval = ConnectRapi()

    key = "Comm\AsyncMac"
    subKey = "DisplayName"

    lngResult = CeRegOpenKeyEx(HKEY_LOCAL_MACHINE, key, 0, 0,
lngKeyPointer)
    If lngResult <> 0 Then
        iretval = DisconnectRapi()
        Exit Sub
    End If
    lngResult = CeRegQueryValueEx(lngKeyPointer, subKey, 0, lpType,
lpData(0), lpcbData)

**lngResult is always 2 never 0**

    If lngResult = 0 Then
        Value = UnicodeToAnsiByte(lpData)
        MsgBox Value
    End If

    iretval = DisconnectRapi()

I have verified that the key exists and that it has a value in the
registry.

I wish to ultimately use this to determine what version of the .NET CF
is installed on the handheld, but one thing at a time.

I would greatly appreciate anyone pointing out what I am doing wrong
and why my code does not work.

Sean M. Severson

2. Deployment Registry Entries - VB.Net

3. eidt registry entry within .NET application

I ran into Excel alphanumeric data column import using ADO.NEt.
Upon searching, I found this solution, but it requires edit a registry entry 
as follow:
Hkey_Local_Machine/Software/Microsoft/Jet/4.0/Engines/Excel/TypeGuessRowsThat 
says how many rows to scan to guess the datatype. The default is 8, but you 
can set it anywhere from 0-16 decimal (0 meaning "scan the first 16384 
rows", and all other values meaning what they say). Putting this all 
together, the most reliable way to read a US/Canadian postal code is to use 
the following registry settings:

TypeGuessRows = 0
ImportMixedTypes = TextIs it possible to build a function to verify and edit 
the registry in question?ThanksBill 


4. Programmatically Find All Registry Entries - VB.Net

5. mdac registry entry

hi,

which registrty entry would i look up to find out which mdac version is on a
given machine?

is mdac installed per user or globally for all users?

thanks

ray


6. .net framework 1.1 registry entry - VB.Net

7. Create Registry Entry On Install.

Hi.  Does anyone have a way of creating a registry entry during the VB Net 
2003 installation process?  I can't rely on the application adding the entry 
on first run.

Any help gratefully recevied.

Cheers,
Tull. 


8. registry entry for "Automatically detect settings"