From 3f12802a19f93fec99b5186b0d39c3fa2f783c6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Pazdiora?= Date: Tue, 5 Jan 2021 03:46:57 +0100 Subject: add devicelist app --- devicelist/App.config | 6 +++ devicelist/Program.cs | 27 +++++++++++++ devicelist/Properties/AssemblyInfo.cs | 36 +++++++++++++++++ devicelist/devicelist.csproj | 73 +++++++++++++++++++++++++++++++++++ 4 files changed, 142 insertions(+) create mode 100644 devicelist/App.config create mode 100644 devicelist/Program.cs create mode 100644 devicelist/Properties/AssemblyInfo.cs create mode 100644 devicelist/devicelist.csproj (limited to 'devicelist') diff --git a/devicelist/App.config b/devicelist/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/devicelist/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/devicelist/Program.cs b/devicelist/Program.cs new file mode 100644 index 0000000..6ac08f6 --- /dev/null +++ b/devicelist/Program.cs @@ -0,0 +1,27 @@ +using System; +using System.Text; +using System.Management; +using System.Windows.Forms; + +namespace devicelist +{ + class Program + { + static void Main(string[] args) + { + ManagementObjectSearcher searcher = new ManagementObjectSearcher(new SelectQuery("Win32_PnPEntity")); + + foreach (ManagementObject obj in searcher.Get()) + { + if (obj["PNPClass"].ToString() == "Mouse" && obj["HardwareID"] != null) { + String[] hwidArray = (String[])(obj["HardwareID"]); + String hwid = hwidArray[0].ToString().Replace(@"\", @"\\"); + String caption = "(" + obj["Name"].ToString() + ") Device Hardware ID:"; + if (MessageBox.Show(hwid, caption, MessageBoxButtons.OKCancel) == DialogResult.Cancel) { + break; + } + } + } + } + } +} diff --git a/devicelist/Properties/AssemblyInfo.cs b/devicelist/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..36f0015 --- /dev/null +++ b/devicelist/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Raw Accel devicelist")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Raw Accel")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("3666b731-7406-41b1-bcfc-c65073fd09a1")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion(RawAccelVersion.value)] +[assembly: AssemblyFileVersion(RawAccelVersion.value)] diff --git a/devicelist/devicelist.csproj b/devicelist/devicelist.csproj new file mode 100644 index 0000000..378c518 --- /dev/null +++ b/devicelist/devicelist.csproj @@ -0,0 +1,73 @@ + + + + + Debug + AnyCPU + {3666B731-7406-41B1-BCFC-C65073FD09A1} + WinExe + devicelist + devicelist + v4.7.2 + 512 + true + true + + + true + $(SolutionDir)$(Platform)\$(Configuration)\ + DEBUG;TRACE + full + x64 + 7.3 + prompt + MinimumRecommendedRules.ruleset + true + + + $(SolutionDir)$(Platform)\$(Configuration)\ + TRACE + true + pdbonly + x64 + 7.3 + prompt + MinimumRecommendedRules.ruleset + true + + + + + + + + + + + + + + + + + + + + + + + + + + + {28a3656f-a1de-405c-b547-191c32ec555f} + wrapper + + + + + IF ($(ConfigurationName)) == (Debug) GOTO END +copy /Y "$(TargetPath)" "$(SolutionDir)signed\$(TargetFileName)" +:END + + \ No newline at end of file -- cgit v1.2.3