H
Hilton
Hi,
X51, WM 5, using OpenNETCF for Registry changes, viewing registry using IBE
RegEditor
LM\ControlPanel\GPS Settings\hide=1 <-- verified by RegEditor
I run app that removes hide=1 and adds "Group=2". I make sure to both close
and dispose, code is:
try
{
// Open the "GPS Settings" registry key and make it
writable
rk = Registry.LocalMachine.OpenSubKey
(@"ControlPanel\GPS Settings", true);
MessageBox.Show (rk.GetValue ("Hide").ToString ());
rk.DeleteValue ("Hide", false); <-- false means
don't throw exception is value does not exist
rk.DeleteValue ("Redirect", false);
rk.SetValue ("Group", "2",
RegistryValueKind.DWord);
}
catch (Exception ex)
{
MessageBox.Show (ex.ToString());
}
finally
{
if (rk != null)
{
rk.Close ();
rk.Dispose ();
}
}
No exception, I close app. RegEditor reports "hide" is gone and "Group=2" -
correct! GPS Manager does not appear, so I do a warm reboot. After warm
reboot GPS Manager is still not shown and RegEditor shows (the old) "hide=1"
and no Group - wrong!
Why do my registry changes not persist? BTW: "hide=1" is not some default
setting, I created this using RegEditor to simulate some Pocket PCs that get
shipped with that setting.
Wierd...
Hilton
X51, WM 5, using OpenNETCF for Registry changes, viewing registry using IBE
RegEditor
LM\ControlPanel\GPS Settings\hide=1 <-- verified by RegEditor
I run app that removes hide=1 and adds "Group=2". I make sure to both close
and dispose, code is:
try
{
// Open the "GPS Settings" registry key and make it
writable
rk = Registry.LocalMachine.OpenSubKey
(@"ControlPanel\GPS Settings", true);
MessageBox.Show (rk.GetValue ("Hide").ToString ());
rk.DeleteValue ("Hide", false); <-- false means
don't throw exception is value does not exist
rk.DeleteValue ("Redirect", false);
rk.SetValue ("Group", "2",
RegistryValueKind.DWord);
}
catch (Exception ex)
{
MessageBox.Show (ex.ToString());
}
finally
{
if (rk != null)
{
rk.Close ();
rk.Dispose ();
}
}
No exception, I close app. RegEditor reports "hide" is gone and "Group=2" -
correct! GPS Manager does not appear, so I do a warm reboot. After warm
reboot GPS Manager is still not shown and RegEditor shows (the old) "hide=1"
and no Group - wrong!
Why do my registry changes not persist? BTW: "hide=1" is not some default
setting, I created this using RegEditor to simulate some Pocket PCs that get
shipped with that setting.
Wierd...
Hilton