Jump to content

Create a program that changes a register value


Guest McCune

Recommended Posts

I'm pretty new to developing programs for PocketPC's, but I really would like to create my own little program :)

I already have Visual Studio 5 and Windows Mobile 5.0 SDK.

What I would like to do is select an option in my program. When selected it should change a register value.

For example:

====

Choose one of the following options:

CAPS indicator of the keyboard?

|O| On |O| Off

Save - Cancel

===

This is a small example of what I would like to do. What the program does behind the scenes is very simple actually:

When selected ‘yes’ it should change the register value to:

\HKCU\ControlPanel\Keyb\EnableIndicator -> DWORD ‘1’.

When selected ‘no’ it should change the register value to:

\HKCU\ControlPanel\Keyb\EnableIndicator -> DWORD ‘0’.

When you press ‘Cancel’ I want to undo all changes.

When ‘Save’ is pressed, it should save all selected items and exit the program.

I think when I know how to do one item it’s not to hard to add more after that.

Hope anyone can help me with this one! :D

Link to comment
Share on other sites

  • 4 weeks later...
Guest its_millertime22

First of all I hope you mean Visual Studio 2005...

The code is very simple in C#:

Code for YES:

RegistryKey OurKey = Registry.CurrentUser; // Create OurKey set to HKEY_CU

OurKey = OurKey.CreateSubKey(@"ControlPanel\Keyb", true); // Set it to the correct key in the registry

OurKey.SetValue("EnableIndicator", 1, RegistryValueKind.DWord); //Write orOverwrite the DWORD value
Code for NO:
RegistryKey OurKey = Registry.CurrentUser; // Create OurKey set to HKEY_CU

OurKey = OurKey.CreateSubKey(@"ControlPanel\Keyb", true); // Set it to the correct key in the registry

OurKey.SetValue("EnableIndicator", 0, RegistryValueKind.DWord); //Write orOverwrite the DWORD value

When selected ‘yes’ it should change the register value to:

\HKCU\ControlPanel\Keyb\EnableIndicator -> DWORD ‘1’.

When selected ‘no’ it should change the register value to:

\HKCU\ControlPanel\Keyb\EnableIndicator -> DWORD ‘0’.

<{POST_SNAPBACK}>

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.