Add Today Item

I have been try to figure out how to add a Today Item which is in quotes and nothing seens to work. Any help would be greatly appreciated. Here is the code that I have been trying to get working.

Microsoft.Win32.Registry.LocalMachine.CreateSubKey("\Software\Microsoft\Windows\Today\Items\'Wireless'")
Microsoft.Win32.Registry.SetValue(
"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Today\Items\'Wireless'", "DLL", "netui.dll", Microsoft.Win32.RegistryValueKind.String)
Microsoft.Win32.Registry.SetValue(
"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Today\Items\'Wireless'", "Order", 1, Microsoft.Win32.RegistryValueKind.DWord)
Microsoft.Win32.Registry.SetValue(
"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Today\Items\'Wireless'", "Enabled", 1, Microsoft.Win32.RegistryValueKind.DWord)
Microsoft.Win32.Registry.SetValue(
"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Today\Items\'Wireless'", "Type", 4, Microsoft.Win32.RegistryValueKind.DWord)
Microsoft.Win32.Registry.SetValue(
"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Today\Items\'Wireless'", "Flags", 0, Microsoft.Win32.RegistryValueKind.DWord)
Microsoft.Win32.Registry.SetValue(
"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Today\Items\'Wireless'", "Options", 0, Microsoft.Win32.RegistryValueKind.DWord)

Thank again for the help.

Mark



Answer this question

Add Today Item

  • Alex1st

    Sorry about that I am using Framwork 2.0 SP1 Visual Basic.

    The quotes are for the Wireless key.

    Thanks.


  • HbH

    I can successfully create the key using the emulator and mobile device, there is no bug in the framework I believe.



  • Meaning Of Lights

    could I also ask what happens when "it doesnt work" what are you seeing what do you expect to see

  • TiborK

    Strange, I have not been able to get it to work on the emulator or the device. If I may ask what was the code you used
  • WhitebearJPN

    I just found a bit more info on this registry key, seems like your were only including single quotes rather than double quotes. What happens if you include double quotes like the following:

    Microsoft.Win32.Registry.SetValue("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Today\Items\""Wireless""", "DLL", "netui.dll", Microsoft.Win32.RegistryValueKind.String)



  • Praveen Dayanithi

    Well I have tried every way you all have showed me and still no error or "Today Item" key made. I have tried it with no quotes, single, and double quotes. Is this a bug in Compact framwork Here is the latest code I have tried;

    If CheckBox5.Enabled = True And CheckBox5.CheckState = CheckState.Checked Then
    Microsoft.Win32.Registry.LocalMachine.CreateSubKey("\Software\Microsoft\Windows\Today\Items\Wireless")
    Microsoft.Win32.Registry.SetValue("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Today\Items\Wireless", "Order", 1, Microsoft.Win32.RegistryValueKind.DWord)
    Microsoft.Win32.Registry.SetValue(
    "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Today\Items\Wireless", "Enabled", 1, Microsoft.Win32.RegistryValueKind.DWord)
    Microsoft.Win32.Registry.SetValue(
    "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Today\Items\Wireless", "Type", 4, Microsoft.Win32.RegistryValueKind.DWord)
    Microsoft.Win32.Registry.SetValue(
    "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Today\Items\Wireless", "Flags", 0, Microsoft.Win32.RegistryValueKind.DWord)
    Microsoft.Win32.Registry.SetValue(
    "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Today\Items\Wireless", "Options", 0, Microsoft.Win32.RegistryValueKind.DWord)
    End If

    Thanks.


  • rolandpish

    what type of quotes

     

    What language are you developing in VB C# What version of the framework



  • simsod

    OKay, I found out what I was doing wrong. I had the path wrong, it was creating the keys but in the wrong place. Thank you enveryone for the help!!!

    Mark


  • abousoft

    It gives no error, and does not create any registry setting. If I create the settings manually then I get a Today item Wireless on the today screen. This give the status of the WiFi and Bluetooth if on/off.
  • LegendRey

    OK, firstly, do you have to put Wireless in quotes

    Secondly, you are best to create the keys this way:



    Dim theRegistryKey as new RegistryKey()
    theRegistryKey.CreateSubKey("\Software\Microsoft\Windows\Today\Items\Wireless")
    theRegistryKey.SetValue(.......)
    theRegistryKey.Close()

    it is better overall to use the RegistryKey class instance to open/create and close the key.

    What happens if you take out the quotes from Wireless - does it work I'm unable to test it at the moment on an actual device until later so I thought I would post all possibilities now

    Thanks!



  • Deepak Goyal

    When I tried double quotes I got a syntax error. I also tried this:

    Microsoft.Win32.Registry.SetValue("""HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Today\Items\""Wireless""", "DLL", "netui.dll", Microsoft.Win32.RegistryValueKind.String)

    No syntax error but it also did not create the registry settings.

    Thanks.


  • Miles100

    code was the exact same as you were using, and the code I had supplied earlier

    Question  I have for you is

    1) are the keys being made Can you check in the registry, after creating the keys, if the keys have been made

     

     



  • kenneth123

    I'm not sure why are you trying to put the extra quotes around the registry path, but considering all that has been said I suggest to do this

    Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.LocalMachine.CreateSubKey("Software\Microsoft\Windows\Today\Items\'Wireless'")
    key.SetValue("DLL", "netui.dll", Microsoft.Win32.RegistryValueKind.String)

    etc



  • Sir Sean

    No keys are being made. I have check the registry. I do not understand what is wrong, I have made new key for other registry settings with no problem but the Today item does nothing. The only thing I can think off is my problem starts with the initial creation of the new key. Any Ideas
  • Add Today Item