[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 172
  • Last Modified:

Set a registry value

It want to set a registry value under HKCU\Software\MyApplication

DWord: MyData
Value: 0xffff

What are the code I need to write to archieve this?
0
matchz
Asked:
matchz
  • 2
  • 2
1 Solution
 
nihtilaCommented:
Hi!

In VB you can write to the registry with Savesetting command as:

SaveSetting Application, Section, Key, Your value

But it's limited to the section:

'VBA and VB settings'/your program name/...

If you want to write to other locations you must use Win32 API.
0
 
matchzAuthor Commented:
In fact, the program I am writing are going to modify the registry value that don't belong it, such as ICQ, or netscape, etc.
0
 
VbmasterCommented:
Here's a class I made to make registry editing really easy, it works as a wrapper around the registry API's..

http://www.cyd.liu.se/~freqv416/clsRegistry.cls
0
 
VbmasterCommented:
Humm.. maybe I should have added a example even if the class is really really easy to use. ,)

  Dim Registry As New clsRegistry
 
  Call Registry.CreateNewKey(HKEY_CURRENT_USER, "Software\MyApplication")
  Call Registry.SetKeyValue(HKEY_CURRENT_USER, "Software\MyApplication", "MyData", &HFFFF, REG_DWORD)

0
 
matchzAuthor Commented:
Thank for you library
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now