Click here to Skip to main content
15,894,405 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
private void button7_Click(object sender, EventArgs e)
        {
            {
                Counter = 300;
                try
                {                  
                    {
                        RegistryKey systemRegistry = Registry.LocalMachine.CreateSubKey("\\SYSTEM\\ControlSet001\\Control\\Keyboard Layout");
                        systemRegistry.SetValue("Scancode Map", 00000000000000000300000000005BE000005CE000000000); //>>BE000005CE000000000 Value get error (The name '' does not exist in the current context)
                    }                   
                }
                catch (Exception)
                {
                    MessageBox.Show("Run this application as Admin to Enable or Disable", "@Need Administrator@");
                }
                DialogResult dialogResult = MessageBox.Show("PC have to reboot for effective", "Attention", MessageBoxButtons.YesNo);
                if (dialogResult == DialogResult.Yes)
                {
                    Process.Start("shutdown", "-R -t 00");
                }
            }
Posted
Updated 18-Nov-15 19:00pm
v2

 
Share this answer
 
The number 00000000000000000300000000005BE000005CE000000000 is a 192 bit number and the largest you can store is a 64 bit number (QWord)

See
RegistryKey.SetValue Method (String, Object, RegistryValueKind)[^]
and
https://msdn.microsoft.com/en-us/library/microsoft.win32.registryvaluekind(v=vs.110).aspx[^]

You better divide your value into three parts
C#
systemRegistry.SetValue("Scancode Map1", 0x00005CE000000000, RegistryValueKind.QWord);
systemRegistry.SetValue("Scancode Map2", 0x0300000000005BE0, RegistryValueKind.QWord);
systemRegistry.SetValue("Scancode Map3", 0x0000000000000000, RegistryValueKind.QWord);

or store it as a string
C#
systemRegistry.SetValue("Scancode Map", " 00000000000000000300000000005BE000005CE000000000", RegistryValueKind.String);
 
Share this answer
 
Comments
Nigol_Learner 19-Nov-15 20:43pm    
thanks bros........

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900