diff options
| author | Tomáš Pazdiora <[email protected]> | 2021-01-05 03:46:57 +0100 |
|---|---|---|
| committer | Tomáš Pazdiora <[email protected]> | 2021-01-05 04:38:22 +0100 |
| commit | 3f12802a19f93fec99b5186b0d39c3fa2f783c6a (patch) | |
| tree | 793aa5cb234caa5e1cbc39bff7fb4b148c246561 /devicelist | |
| parent | fix .rc files (diff) | |
| download | rawaccel-3f12802a19f93fec99b5186b0d39c3fa2f783c6a.tar.xz rawaccel-3f12802a19f93fec99b5186b0d39c3fa2f783c6a.zip | |
add devicelist app
Diffstat (limited to 'devicelist')
| -rw-r--r-- | devicelist/App.config | 6 | ||||
| -rw-r--r-- | devicelist/Program.cs | 27 | ||||
| -rw-r--r-- | devicelist/Properties/AssemblyInfo.cs | 36 | ||||
| -rw-r--r-- | devicelist/devicelist.csproj | 73 |
4 files changed, 142 insertions, 0 deletions
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 @@ +<?xml version="1.0" encoding="utf-8" ?> +<configuration> + <startup> + <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /> + </startup> +</configuration>
\ 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 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectGuid>{3666B731-7406-41B1-BCFC-C65073FD09A1}</ProjectGuid> + <OutputType>WinExe</OutputType> + <RootNamespace>devicelist</RootNamespace> + <AssemblyName>devicelist</AssemblyName> + <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> + <Deterministic>true</Deterministic> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'"> + <DebugSymbols>true</DebugSymbols> + <OutputPath>$(SolutionDir)$(Platform)\$(Configuration)\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <DebugType>full</DebugType> + <PlatformTarget>x64</PlatformTarget> + <LangVersion>7.3</LangVersion> + <ErrorReport>prompt</ErrorReport> + <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> + <Prefer32Bit>true</Prefer32Bit> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'"> + <OutputPath>$(SolutionDir)$(Platform)\$(Configuration)\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <Optimize>true</Optimize> + <DebugType>pdbonly</DebugType> + <PlatformTarget>x64</PlatformTarget> + <LangVersion>7.3</LangVersion> + <ErrorReport>prompt</ErrorReport> + <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> + <Prefer32Bit>true</Prefer32Bit> + </PropertyGroup> + <PropertyGroup> + <StartupObject /> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Core" /> + <Reference Include="System.Management" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml.Linq" /> + <Reference Include="System.Data.DataSetExtensions" /> + <Reference Include="Microsoft.CSharp" /> + <Reference Include="System.Data" /> + <Reference Include="System.Net.Http" /> + <Reference Include="System.Xml" /> + <Reference Include="System.Management" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <None Include="App.config" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\wrapper\wrapper.vcxproj"> + <Project>{28a3656f-a1de-405c-b547-191c32ec555f}</Project> + <Name>wrapper</Name> + </ProjectReference> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <PropertyGroup> + <PostBuildEvent>IF ($(ConfigurationName)) == (Debug) GOTO END +copy /Y "$(TargetPath)" "$(SolutionDir)signed\$(TargetFileName)" +:END</PostBuildEvent> + </PropertyGroup> +</Project>
\ No newline at end of file |