Results 1 to 2 of 2

Thread: How can I add Hex Value to registry

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2009
    Posts
    76

    Thumbs down How can I add Hex Value to registry

    I am trying to add Hex value to registry, but i don't know how to can anyone help

    this si what I want to add.

    [HKEY_CLASSES_ROOT\AudioCD\shell\play]
    "MUIVerb"=hex(2):40,00,25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,\
    6f,00,74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,\
    00,75,00,6e,00,72,00,65,00,67,00,6d,00,70,00,32,00,2e,00,65,00,78,00,65,00,\
    2c,00,2d,00,39,00,39,00,39,00,31,00,00,00
    @="&Play"
    < advertising link removed by moderator >

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: How can I add Hex Value to registry

    That Registry value is type REG_EXPAND_SZ and those numbers are the Unicode values of the characters in that string. Notice this part near the end:
    2d,00,39,00,39,00,39,00,31,00
    That corresponds to the -9991 at the end of the value in the Registry. The Unicode values for the characters '-', '9' and '1' are 2D, 39 and 31 respectively.

    So, if you have data in that form, you need to convert the numeric values to text and then call RegistryKey.SetValue and specify the RegistryValueKind as ExpandString.

    An easier way might to simply execute a REG file containing that data, so Windows can handle the import for you.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width