|
using Microsoft.Win32;
namespace RawInput_dll
{
static internal class RegistryAccess
{
static internal RegistryKey GetDeviceKey(string device)
{
var split = device.Substring(4).Split('#');
var classCode = split[0]; // ACPI (Class code)
var subClassCode = split[1]; // PNP0303 (SubClass code)
var protocolCode = split[2]; // 3&13c0b0c5&0 (Protocol code)
return Registry.LocalMachine.OpenSubKey(string.Format(@"System\CurrentControlSet\Enum\{0}\{1}\{2}", classCode, subClassCode, protocolCode));
}
static internal string GetClassType(string classGuid)
{
var classGuidKey = Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Control\Class\" + classGuid);
return classGuidKey != null ? (string)classGuidKey.GetValue("Class") : string.Empty;
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Emma's first steps in programming took place at primary school over thirty years ago, thanks to a TI-99/4A and the LOGO language. Following a Master's degree in English Studies (obtained, strangely enough, with a paper on the birth of the microcomputer), Emma started her career in IT.
Over the last ten years, she has worked as a localiser, technical writer, editor, web designer, systems administrator, team leader and support engineer, before finally making the move into software development a few years ago. She is now thrilled on a daily basis that she is getting paid for writing code after doing it for free half her life!
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.