├── .gitignore ├── HidDemoWPF.PNG ├── HidDemoConsole.PNG ├── HidDemoWindowsForms.PNG ├── WindowsForms ├── app.config ├── Properties │ ├── Settings.settings │ ├── Settings.Designer.cs │ ├── AssemblyInfo.cs │ ├── app.manifest │ ├── Resources.Designer.cs │ └── Resources.resx ├── HidDemoWindowsForms.csproj.user ├── Program.cs ├── HidDemoWindowsForms.csproj ├── Form1.resx ├── Form1.cs └── Form1.Designer.cs ├── WPF ├── App.config ├── Properties │ ├── Settings.settings │ ├── Settings.Designer.cs │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── App.xaml ├── HidDemoWpf.csproj.user ├── MainWindow.xaml.cs ├── HidDemoWpf.csproj ├── MainWindow.xaml └── App.xaml.cs ├── Console ├── App.config ├── Properties │ ├── Settings.settings │ ├── Settings.Designer.cs │ └── AssemblyInfo.cs ├── HidDemoConsole.csproj.user ├── HidDemoConsole.csproj └── Program.cs ├── HidUtilityDll ├── Properties │ └── AssemblyInfo.cs └── HidUtilityDll.csproj ├── HidUtilityNuget ├── HidUtilityNuget.csproj └── hid.cs ├── HidUtilityDemo.sln └── README.txt /.gitignore: -------------------------------------------------------------------------------- 1 | */bin/* 2 | 3 | */obj/* 4 | Backup/* 5 | .git/* 6 | .vs/* 7 | *.db -------------------------------------------------------------------------------- /HidDemoWPF.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soldernerd/HID_Utility/HEAD/HidDemoWPF.PNG -------------------------------------------------------------------------------- /HidDemoConsole.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soldernerd/HID_Utility/HEAD/HidDemoConsole.PNG -------------------------------------------------------------------------------- /HidDemoWindowsForms.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soldernerd/HID_Utility/HEAD/HidDemoWindowsForms.PNG -------------------------------------------------------------------------------- /WindowsForms/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /WPF/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Console/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /WPF/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Console/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /WindowsForms/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /WPF/App.xaml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /WPF/HidDemoWpf.csproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | publish\ 5 | 6 | 7 | 8 | 9 | 10 | en-US 11 | false 12 | 13 | -------------------------------------------------------------------------------- /Console/HidDemoConsole.csproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | publish\ 5 | 6 | 7 | 8 | 9 | 10 | en-US 11 | false 12 | 13 | -------------------------------------------------------------------------------- /WindowsForms/HidDemoWindowsForms.csproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | publish\ 5 | 6 | 7 | 8 | 9 | 10 | en-US 11 | false 12 | 13 | -------------------------------------------------------------------------------- /WindowsForms/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Windows.Forms; 4 | 5 | namespace HidDemoWindowsForms 6 | { 7 | static class Program 8 | { 9 | /// 10 | /// The main entry point for the application. 11 | /// 12 | [STAThread] 13 | static void Main() 14 | { 15 | Application.EnableVisualStyles(); 16 | Application.SetCompatibleTextRenderingDefault(false); 17 | Application.Run(new Form1()); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /WPF/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace HidDemoWpf.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Console/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace HidDemoConsole.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /WindowsForms/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace HidDemoWindowsForms.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /WindowsForms/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("HidDemoWindowsForms")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Soldernerd.com")] 12 | [assembly: AssemblyProduct("HidDemoWindowsForms")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("63f053db-de5b-4715-af73-ed2baaa1b5a8")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | [assembly: AssemblyVersion("1.0.0.0")] 32 | [assembly: AssemblyFileVersion("1.0.0.0")] 33 | -------------------------------------------------------------------------------- /Console/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("HidDemoConsole")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Soldernerd.com")] 12 | [assembly: AssemblyProduct("HidDemoConsole")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("42e80ef3-1acf-413e-9ac0-1d1daed560fa")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /HidUtilityDll/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("HidUtilityDll")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Bank Vontobel AG")] 12 | [assembly: AssemblyProduct("HidUtilityDll")] 13 | [assembly: AssemblyCopyright("Copyright © Bank Vontobel AG 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("2a94bc3c-369a-41b2-855e-3fcfca016c88")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /HidUtilityNuget/HidUtilityNuget.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net46 5 | true 6 | Lukas Fässler 7 | soldernerd.com 8 | HidUtility 9 | A NuGet that allows a .NET application to communicate with a USB HID device in a simple and straight forward way without having to worry about all the COM objects and technical details. It's written in C# and mainly targets that language. It provides a main object, HidUtility, that one can use to subscribe to events such as when a package is received over USB or when a USB device is attached or detached. 10 | GNU GPLv3 11 | https://www.gnu.org/licenses/gpl-3.0.en.html 12 | https://soldernerd.com/2017/02/14/c-usb-hid-utility/ 13 | https://github.com/soldernerd/HID_Utility 14 | 15 | Library 16 | 17 | Release 18 | AnyCPU;x86 19 | en 20 | 21 | 22 | 23 | true 24 | x86 25 | 26 | 27 | 28 | true 29 | x86 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /HidUtilityDemo.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.26730.16 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HidDemoWindowsForms", "WindowsForms\HidDemoWindowsForms.csproj", "{16F6C5BD-2B6A-46A1-96E6-7BEB4E0AB5E7}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HidDemoWpf", "WPF\HidDemoWpf.csproj", "{4D03A54E-0AC7-4B7B-8BC2-33254C454980}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HidDemoConsole", "Console\HidDemoConsole.csproj", "{42E80EF3-1ACF-413E-9AC0-1D1DAED560FA}" 11 | EndProject 12 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HidUtilityNuget", "HidUtilityNuget\HidUtilityNuget.csproj", "{65306590-5C1D-4FCE-BC43-E58B6DD32B8E}" 13 | EndProject 14 | Global 15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 16 | Release|x86 = Release|x86 17 | EndGlobalSection 18 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 19 | {16F6C5BD-2B6A-46A1-96E6-7BEB4E0AB5E7}.Release|x86.ActiveCfg = Release|x86 20 | {16F6C5BD-2B6A-46A1-96E6-7BEB4E0AB5E7}.Release|x86.Build.0 = Release|x86 21 | {4D03A54E-0AC7-4B7B-8BC2-33254C454980}.Release|x86.ActiveCfg = Release|x86 22 | {4D03A54E-0AC7-4B7B-8BC2-33254C454980}.Release|x86.Build.0 = Release|x86 23 | {42E80EF3-1ACF-413E-9AC0-1D1DAED560FA}.Release|x86.ActiveCfg = Release|x86 24 | {42E80EF3-1ACF-413E-9AC0-1D1DAED560FA}.Release|x86.Build.0 = Release|x86 25 | {65306590-5C1D-4FCE-BC43-E58B6DD32B8E}.Release|x86.ActiveCfg = Release|x86 26 | {65306590-5C1D-4FCE-BC43-E58B6DD32B8E}.Release|x86.Build.0 = Release|x86 27 | EndGlobalSection 28 | GlobalSection(SolutionProperties) = preSolution 29 | HideSolutionNode = FALSE 30 | EndGlobalSection 31 | GlobalSection(ExtensibilityGlobals) = postSolution 32 | SolutionGuid = {B38E5B7C-10A9-45B8-AE8E-ACFB11590AB9} 33 | EndGlobalSection 34 | EndGlobal 35 | -------------------------------------------------------------------------------- /README.txt: -------------------------------------------------------------------------------- 1 | This open source (GNU GPLv3) project is aimed at simplifying the development of C# applications that communicate with USB HID (Human Interface Device) devices. 2 | 3 | There used to be a Microchip HID PnP Demo application that demonstrated how to connect to a HID device from C#. 4 | The demo is designed to work with their USB demo boards such as the "PIC18F46J50 FS USB Demo Board" (see http://www.microchip.com/Developmenttools/ProductDetails.aspx?PartNO=MA180024) 5 | However, that particular application was based on VisualStudio 2010 and .NET framework 2.0 and no longer gets maintained it seems. 6 | 7 | This VisualStudio solution was created on VisualStudio Community 2015 (which is free) and .NET framework 4.6. Please be aware that all projects must be compiled with "x86" setting even on a 64bit platform. 8 | There are 3 projects in this solution: 9 | 10 | - A WindowsForm application named HidDemoWindowsForms 11 | - A WPF application named HidDemoWpf 12 | - A Console application named HidDemoConsole 13 | 14 | All 3 projects offer very similar functionality. They connect to suitably programmed HID device, read an ADC value and pushbutton state and let you toggle an LED. They also list all available HID devices and notify you when a device is attached or detached. 15 | 16 | All the heavy lifting is done in a common file named hid.cs. It can be included in any C# project, no matter if it is based on WPF, WindowsForms or just a console application. It's full of DLL imports, Marshalling and COM API calls. In other words, it's not pretty and it doesn't look much like C# even though it is. You should not need to edit this file or know anything about it. 17 | 18 | hid.cs offers a nice, truely C# interface that lets you communicate to HID devices. Basically all you need to do is to create an instance of HidUtility and subscribe to the events you're interested in. The 3 applications should give you a good starting point. 19 | 20 | More information is available on https://soldernerd.com/2017/02/14/c-usb-hid-utility/ 21 | 22 | Lukas Fässler 23 | soldernerd.com 24 | 2017-02-13 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /WPF/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Navigation; 14 | using System.Windows.Shapes; 15 | using System.Runtime.InteropServices; 16 | using System.Windows.Interop; 17 | using System.Management; 18 | using System.Text.RegularExpressions; 19 | 20 | namespace HidDemoWpf 21 | { 22 | 23 | /// 24 | /// Interaction logic for MainWindow.xaml 25 | /// 26 | public partial class MainWindow : Window 27 | { 28 | public MainWindow() 29 | { 30 | InitializeComponent(); 31 | } 32 | 33 | // Update when focus is lost 34 | public void FocusLostHandler(object sender, EventArgs e) 35 | { 36 | try 37 | { 38 | TextBox tb = (TextBox)sender; 39 | tb.GetBindingExpression(TextBox.TextProperty).UpdateSource(); 40 | } 41 | catch 42 | { 43 | //nothin to do 44 | } 45 | } 46 | 47 | // Update if ENTER key has been pressed 48 | public void KeyUpHander(object sender, KeyEventArgs e) 49 | { 50 | try 51 | { 52 | TextBox tb = (TextBox)sender; 53 | if (e.Key == Key.Enter) 54 | { 55 | tb.GetBindingExpression(TextBox.TextProperty).UpdateSource(); 56 | } 57 | } 58 | catch 59 | { 60 | //nothin to do 61 | } 62 | } 63 | 64 | //Scroll to bottom when text is changed 65 | public void ActivityLogTextChangedHandler(object sender, EventArgs e) 66 | { 67 | ActivityLogScrollViewer.ScrollToBottom(); 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /WindowsForms/Properties/app.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /WPF/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("HidUtilityDemo")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("Soldernerd.com")] 14 | [assembly: AssemblyProduct("HidUtilityDemo")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | 18 | // Setting ComVisible to false makes the types in this assembly not visible 19 | // to COM components. If you need to access a type in this assembly from 20 | // COM, set the ComVisible attribute to true on that type. 21 | [assembly: ComVisible(false)] 22 | 23 | //In order to begin building localizable applications, set 24 | //CultureYouAreCodingWith in your .csproj file 25 | //inside a . For example, if you are using US english 26 | //in your source files, set the to en-US. Then uncomment 27 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 28 | //the line below to match the UICulture setting in the project file. 29 | 30 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 31 | 32 | 33 | [assembly: ThemeInfo( 34 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 35 | //(used if a resource is not found in the page, 36 | // or application resource dictionaries) 37 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 38 | //(used if a resource is not found in the page, 39 | // app, or any theme specific resource dictionaries) 40 | )] 41 | 42 | 43 | // Version information for an assembly consists of the following four values: 44 | // 45 | // Major Version 46 | // Minor Version 47 | // Build Number 48 | // Revision 49 | // 50 | // You can specify all the values or you can default the Build and Revision Numbers 51 | // by using the '*' as shown below: 52 | // [assembly: AssemblyVersion("1.0.*")] 53 | [assembly: AssemblyVersion("1.0.0.0")] 54 | [assembly: AssemblyFileVersion("1.0.0.0")] 55 | -------------------------------------------------------------------------------- /HidUtilityDll/HidUtilityDll.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {2A94BC3C-369A-41B2-855E-3FCFCA016C88} 8 | Library 9 | Properties 10 | HidUtilityDll 11 | HidUtilityDll 12 | v4.6 13 | 512 14 | 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | x86 25 | true 26 | 27 | 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | x86 35 | true 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | hid.cs 53 | 54 | 55 | 56 | 57 | 64 | -------------------------------------------------------------------------------- /WPF/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace HidDemoWpf.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HidDemoWpf.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /WindowsForms/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace HidDemoWindowsForms.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HidDemoWindowsForms.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Console/HidDemoConsole.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {42E80EF3-1ACF-413E-9AC0-1D1DAED560FA} 8 | Exe 9 | Properties 10 | HidDemoConsole 11 | HidDemoConsole 12 | v4.6 13 | 512 14 | true 15 | 16 | 17 | 18 | 19 | 20 | 21 | true 22 | bin\x86\Debug\ 23 | DEBUG;TRACE 24 | true 25 | true 26 | full 27 | x86 28 | prompt 29 | MinimumRecommendedRules.ruleset 30 | true 31 | 32 | 33 | bin\x86\Release\ 34 | TRACE 35 | true 36 | true 37 | pdbonly 38 | x86 39 | prompt 40 | MinimumRecommendedRules.ruleset 41 | true 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | hid.cs 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 67 | -------------------------------------------------------------------------------- /WPF/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /WindowsForms/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /WPF/HidDemoWpf.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {4D03A54E-0AC7-4B7B-8BC2-33254C454980} 8 | WinExe 9 | Properties 10 | HidDemoWpf 11 | HidDemoWpf 12 | v4.6 13 | 512 14 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 15 | 4 16 | true 17 | 18 | publish\ 19 | true 20 | Disk 21 | false 22 | Foreground 23 | 7 24 | Days 25 | false 26 | false 27 | true 28 | 0 29 | 1.0.0.%2a 30 | false 31 | false 32 | true 33 | 34 | 35 | true 36 | bin\x86\Debug\ 37 | DEBUG;TRACE 38 | true 39 | full 40 | x86 41 | prompt 42 | MinimumRecommendedRules.ruleset 43 | true 44 | 45 | 46 | bin\x86\Release\ 47 | TRACE 48 | true 49 | true 50 | pdbonly 51 | x86 52 | prompt 53 | MinimumRecommendedRules.ruleset 54 | true 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 4.0 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | MSBuild:Compile 77 | Designer 78 | 79 | 80 | MSBuild:Compile 81 | Designer 82 | 83 | 84 | hid.cs 85 | 86 | 87 | App.xaml 88 | Code 89 | 90 | 91 | MainWindow.xaml 92 | Code 93 | 94 | 95 | 96 | 97 | Code 98 | 99 | 100 | True 101 | True 102 | Resources.resx 103 | 104 | 105 | True 106 | Settings.settings 107 | True 108 | 109 | 110 | ResXFileCodeGenerator 111 | Resources.Designer.cs 112 | 113 | 114 | SettingsSingleFileGenerator 115 | Settings.Designer.cs 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | False 125 | Microsoft .NET Framework 4.6 %28x86 and x64%29 126 | true 127 | 128 | 129 | False 130 | .NET Framework 3.5 SP1 131 | false 132 | 133 | 134 | 135 | 142 | -------------------------------------------------------------------------------- /WindowsForms/HidDemoWindowsForms.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.50727 7 | 2.0 8 | {16F6C5BD-2B6A-46A1-96E6-7BEB4E0AB5E7} 9 | WinExe 10 | Properties 11 | HidDemoWindowsForms 12 | HidDemoWindowsForms 13 | Custom 14 | false 15 | 16 | 17 | v4.6 18 | 19 | 20 | 21 | 22 | 2.0 23 | false 24 | 25 | publish\ 26 | true 27 | Disk 28 | false 29 | Foreground 30 | 7 31 | Days 32 | false 33 | false 34 | true 35 | 0 36 | 1.0.0.%2a 37 | false 38 | true 39 | 40 | 41 | true 42 | full 43 | false 44 | bin\Debug\ 45 | TRACE;DEBUG 46 | prompt 47 | 4 48 | true 49 | true 50 | 512 51 | false 52 | 53 | 54 | pdbonly 55 | true 56 | bin\Release\ 57 | TRACE 58 | prompt 59 | 4 60 | true 61 | true 62 | 512 63 | false 64 | 65 | 66 | x86 67 | bin\x86\Debug\ 68 | TRACE;DEBUG 69 | true 70 | false 71 | 72 | 73 | x86 74 | bin\x86\Release\ 75 | true 76 | 512 77 | pdbonly 78 | true 79 | TRACE 80 | true 81 | true 82 | false 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | hid.cs 97 | 98 | 99 | Form 100 | 101 | 102 | Form1.cs 103 | 104 | 105 | 106 | 107 | Designer 108 | Form1.cs 109 | 110 | 111 | ResXFileCodeGenerator 112 | Resources.Designer.cs 113 | Designer 114 | 115 | 116 | True 117 | Resources.resx 118 | True 119 | 120 | 121 | 122 | 123 | SettingsSingleFileGenerator 124 | Settings.Designer.cs 125 | 126 | 127 | True 128 | Settings.settings 129 | True 130 | 131 | 132 | 133 | 134 | False 135 | .NET Framework 3.5 SP1 136 | true 137 | 138 | 139 | 140 | 147 | -------------------------------------------------------------------------------- /WindowsForms/Form1.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 134, 8 122 | 123 | 124 | 270, 9 125 | 126 | 127 | -694, 83 128 | 129 | 130 | -552, 83 131 | 132 | 133 | -384, 83 134 | 135 | 136 | -292, 83 137 | 138 | 139 | 60 140 | 141 | -------------------------------------------------------------------------------- /WPF/MainWindow.xaml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 72 | 75 | 76 | 77 | 80 | 83 | 86 | 89 | 90 | 91 | 94 | 97 | 98 | 99 | 102 |