From aaf3c3df8524dbcff43242647748d091025bcf56 Mon Sep 17 00:00:00 2001 From: Paul Date: Sun, 23 Sep 2018 00:53:08 -0400 Subject: [PATCH 1/9] Update gitignore --- .gitignore | 333 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 333 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..18dd511 --- /dev/null +++ b/.gitignore @@ -0,0 +1,333 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ From e0dfcab269324bebe8a09bb045609f37f9b43d67 Mon Sep 17 00:00:00 2001 From: Paul Date: Sun, 23 Sep 2018 00:53:17 -0400 Subject: [PATCH 2/9] Add newly created WPF project --- src/VirtualMediaKeysUI/VirtualMediaKeysUI.sln | 25 ++++ .../VirtualMediaKeysUI/App.config | 6 + .../VirtualMediaKeysUI/App.xaml | 9 ++ .../VirtualMediaKeysUI/App.xaml.cs | 17 +++ .../VirtualMediaKeysUI/MainWindow.xaml | 12 ++ .../VirtualMediaKeysUI/MainWindow.xaml.cs | 28 +++++ .../Properties/AssemblyInfo.cs | 55 ++++++++ .../Properties/Resources.Designer.cs | 71 +++++++++++ .../Properties/Resources.resx | 117 ++++++++++++++++++ .../Properties/Settings.Designer.cs | 30 +++++ .../Properties/Settings.settings | 7 ++ .../VirtualMediaKeysUI.csproj | 98 +++++++++++++++ 12 files changed, 475 insertions(+) create mode 100644 src/VirtualMediaKeysUI/VirtualMediaKeysUI.sln create mode 100644 src/VirtualMediaKeysUI/VirtualMediaKeysUI/App.config create mode 100644 src/VirtualMediaKeysUI/VirtualMediaKeysUI/App.xaml create mode 100644 src/VirtualMediaKeysUI/VirtualMediaKeysUI/App.xaml.cs create mode 100644 src/VirtualMediaKeysUI/VirtualMediaKeysUI/MainWindow.xaml create mode 100644 src/VirtualMediaKeysUI/VirtualMediaKeysUI/MainWindow.xaml.cs create mode 100644 src/VirtualMediaKeysUI/VirtualMediaKeysUI/Properties/AssemblyInfo.cs create mode 100644 src/VirtualMediaKeysUI/VirtualMediaKeysUI/Properties/Resources.Designer.cs create mode 100644 src/VirtualMediaKeysUI/VirtualMediaKeysUI/Properties/Resources.resx create mode 100644 src/VirtualMediaKeysUI/VirtualMediaKeysUI/Properties/Settings.Designer.cs create mode 100644 src/VirtualMediaKeysUI/VirtualMediaKeysUI/Properties/Settings.settings create mode 100644 src/VirtualMediaKeysUI/VirtualMediaKeysUI/VirtualMediaKeysUI.csproj diff --git a/src/VirtualMediaKeysUI/VirtualMediaKeysUI.sln b/src/VirtualMediaKeysUI/VirtualMediaKeysUI.sln new file mode 100644 index 0000000..994cf2b --- /dev/null +++ b/src/VirtualMediaKeysUI/VirtualMediaKeysUI.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28010.2019 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VirtualMediaKeysUI", "VirtualMediaKeysUI\VirtualMediaKeysUI.csproj", "{D9C78FCC-CE69-4F1F-B868-B0904AA701F7}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D9C78FCC-CE69-4F1F-B868-B0904AA701F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D9C78FCC-CE69-4F1F-B868-B0904AA701F7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D9C78FCC-CE69-4F1F-B868-B0904AA701F7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D9C78FCC-CE69-4F1F-B868-B0904AA701F7}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {44CF1C93-CEF8-4EFD-AD79-F2724FC65A80} + EndGlobalSection +EndGlobal diff --git a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/App.config b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/App.config new file mode 100644 index 0000000..731f6de --- /dev/null +++ b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/App.xaml b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/App.xaml new file mode 100644 index 0000000..3672247 --- /dev/null +++ b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/App.xaml.cs b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/App.xaml.cs new file mode 100644 index 0000000..718079c --- /dev/null +++ b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/App.xaml.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; + +namespace VirtualMediaKeysUI +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } +} diff --git a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/MainWindow.xaml b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/MainWindow.xaml new file mode 100644 index 0000000..7b422dd --- /dev/null +++ b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/MainWindow.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/MainWindow.xaml.cs b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/MainWindow.xaml.cs new file mode 100644 index 0000000..9e1f454 --- /dev/null +++ b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/MainWindow.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace VirtualMediaKeysUI +{ + /// + /// Interaction logic for MainWindow.xaml + /// + public partial class MainWindow : Window + { + public MainWindow() + { + InitializeComponent(); + } + } +} diff --git a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/Properties/AssemblyInfo.cs b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..0cc94bb --- /dev/null +++ b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/Properties/AssemblyInfo.cs @@ -0,0 +1,55 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// 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("VirtualMediaKeysUI")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("VirtualMediaKeysUI")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[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)] + +//In order to begin building localizable applications, set +//CultureYouAreCodingWith in your .csproj file +//inside a . For example, if you are using US english +//in your source files, set the to en-US. Then uncomment +//the NeutralResourceLanguage attribute below. Update the "en-US" in +//the line below to match the UICulture setting in the project file. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] + + +// 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("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/Properties/Resources.Designer.cs b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/Properties/Resources.Designer.cs new file mode 100644 index 0000000..e4aa3a3 --- /dev/null +++ b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace VirtualMediaKeysUI.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("VirtualMediaKeysUI.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/Properties/Resources.resx b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/Properties/Settings.Designer.cs b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/Properties/Settings.Designer.cs new file mode 100644 index 0000000..db6ae64 --- /dev/null +++ b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace VirtualMediaKeysUI.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/Properties/Settings.settings b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/Properties/Settings.settings new file mode 100644 index 0000000..033d7a5 --- /dev/null +++ b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/VirtualMediaKeysUI.csproj b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/VirtualMediaKeysUI.csproj new file mode 100644 index 0000000..72d7679 --- /dev/null +++ b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/VirtualMediaKeysUI.csproj @@ -0,0 +1,98 @@ + + + + + Debug + AnyCPU + {D9C78FCC-CE69-4F1F-B868-B0904AA701F7} + WinExe + VirtualMediaKeysUI + VirtualMediaKeysUI + v4.6.1 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + 4.0 + + + + + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + App.xaml + Code + + + MainWindow.xaml + Code + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + + \ No newline at end of file From 83b02e3b64f2143f05886d4eb4822e057b3cbf40 Mon Sep 17 00:00:00 2001 From: Paul Date: Sun, 23 Sep 2018 03:10:11 -0400 Subject: [PATCH 3/9] Add a basic UI setup --- .../VirtualMediaKeysUI/App.xaml | 15 +- .../VirtualMediaKeysUI/MainWindow.xaml | 169 ++++++++++++++++-- .../VirtualMediaKeysUI/MainWindow.xaml.cs | 80 +++++++-- .../VirtualMediaKeysUI/Native/DWM.cs | 39 ++++ .../Native/WindowManagement.cs | 22 +++ .../VirtualMediaKeysUI/Util/ColorUtil.cs | 17 ++ .../VirtualMediaKeysUI.csproj | 11 +- .../VirtualMediaKeysUI/packages.config | 4 + 8 files changed, 327 insertions(+), 30 deletions(-) create mode 100644 src/VirtualMediaKeysUI/VirtualMediaKeysUI/Native/DWM.cs create mode 100644 src/VirtualMediaKeysUI/VirtualMediaKeysUI/Native/WindowManagement.cs create mode 100644 src/VirtualMediaKeysUI/VirtualMediaKeysUI/Util/ColorUtil.cs create mode 100644 src/VirtualMediaKeysUI/VirtualMediaKeysUI/packages.config diff --git a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/App.xaml b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/App.xaml index 3672247..5a43a40 100644 --- a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/App.xaml +++ b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/App.xaml @@ -1,9 +1,8 @@ - - - - + + diff --git a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/MainWindow.xaml b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/MainWindow.xaml index 7b422dd..c5f6657 100644 --- a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/MainWindow.xaml +++ b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/MainWindow.xaml @@ -1,12 +1,161 @@ - - - + + + + #FF333333 + White + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/MainWindow.xaml.cs b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/MainWindow.xaml.cs index 9e1f454..10b0832 100644 --- a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/MainWindow.xaml.cs +++ b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/MainWindow.xaml.cs @@ -1,17 +1,10 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; using System.Windows.Input; +using System.Windows.Interop; using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; +using VirtualMediaKeysUI.Native; +using VirtualMediaKeysUI.Util; namespace VirtualMediaKeysUI { @@ -20,9 +13,76 @@ namespace VirtualMediaKeysUI /// public partial class MainWindow : Window { + private const string AccentColorKey = "AccentColor"; + private const string ForegroundColorKey = "ForegroundColor"; + + private static Brush LightAccentForegroundColor = new SolidColorBrush(Color.FromRgb(51, 51, 51)); + private static Brush DarkAccentForegroundColor = Brushes.White; + public MainWindow() { InitializeComponent(); } + + /// + /// Sets the accent color to the system color. + /// + private void SetColor() + { + var color = DWM.GetDwmColor(); + bool isBright = ColorUtil.DwmBrightness(color) > 128; + Resources[AccentColorKey] = new SolidColorBrush(Color.FromRgb(color.R, color.G, color.B)); + Resources[ForegroundColorKey] = isBright ? LightAccentForegroundColor : DarkAccentForegroundColor; + } + + private void Window_SourceInitialized(object sender, EventArgs e) + { + IntPtr handle = new WindowInteropHelper(this).Handle; + HwndSource.FromHwnd(handle).AddHook(WndProc); + SetColor(); + + + + // Set up custom window flags + WindowManagement.SetWindowLongPtr64( + new System.Runtime.InteropServices.HandleRef(null, handle), + WindowManagement.GWL_STYLE, + new IntPtr(WindowManagement.WS_VISIBLE | WindowManagement.WS_SIZEBOX) + ); + WindowManagement.SetWindowLongPtr64( + new System.Runtime.InteropServices.HandleRef(null, handle), + WindowManagement.GWL_EXSTYLE, + new IntPtr(WindowManagement.WS_EX_NOACTIVATE) + ); + } + + /// + /// Handles window messages. + /// + /// + /// + /// + /// + /// + /// + private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) + { + if (msg == DWM.WM_DWMCOLORIZATIONCOLORCHANGED) + { + SetColor(); + } + + return IntPtr.Zero; + } + + private void Caption_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) + { + DragMove(); + } + + private void Close_Click(object sender, RoutedEventArgs e) + { + Close(); + } } } diff --git a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/Native/DWM.cs b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/Native/DWM.cs new file mode 100644 index 0000000..abb9feb --- /dev/null +++ b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/Native/DWM.cs @@ -0,0 +1,39 @@ +using System.Runtime.InteropServices; + +namespace VirtualMediaKeysUI.Native +{ + internal static class DWM + { + public const int WM_DWMCOLORIZATIONCOLORCHANGED = 800; + + [DllImport("dwmapi.dll", PreserveSig = false)] + private static extern void DwmGetColorizationColor(out uint ColorizationColor, [MarshalAs(UnmanagedType.Bool)]out bool ColorizationOpaqueBlend); + + public struct DwmColor + { + public DwmColor(byte a, byte r, byte g, byte b) + { + A = a; + R = r; + G = g; + B = b; + } + + public byte A { get; } + public byte R { get; } + public byte G { get; } + public byte B { get; } + } + + public static DwmColor GetDwmColor() + { + DwmGetColorizationColor(out uint color, out bool isOpaque); + return new DwmColor( + (byte)(color >> 24 & byte.MaxValue), + (byte)(color >> 16 & byte.MaxValue), + (byte)(color >> 8 & byte.MaxValue), + (byte)(color & byte.MaxValue) + ); + } + } +} diff --git a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/Native/WindowManagement.cs b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/Native/WindowManagement.cs new file mode 100644 index 0000000..fe35c66 --- /dev/null +++ b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/Native/WindowManagement.cs @@ -0,0 +1,22 @@ +using System; +using System.Runtime.InteropServices; + +namespace VirtualMediaKeysUI.Native +{ + internal static class WindowManagement + { + public const int GWL_STYLE = -16; + public const int GWL_EXSTYLE = -20; + + public const int WS_VISIBLE = 0x10000000; + public const int WS_SIZEBOX = 0x00040000; + public const int WS_EX_NOACTIVATE = 0x08000000; + public const int WS_EX_APPWINDOW = 0x00040000; + + [DllImport("user32.dll", EntryPoint = "SetWindowLongPtr")] + public static extern IntPtr SetWindowLongPtr64(HandleRef hWnd, int nIndex, IntPtr dwNewLong); + + [DllImport("user32.dll", EntryPoint = "GetWindowLongPtr")] + public static extern IntPtr GetWindowLongPtr64(HandleRef hWnd, int nIndex); + } +} diff --git a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/Util/ColorUtil.cs b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/Util/ColorUtil.cs new file mode 100644 index 0000000..736117e --- /dev/null +++ b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/Util/ColorUtil.cs @@ -0,0 +1,17 @@ +using System; +using static VirtualMediaKeysUI.Native.DWM; + +namespace VirtualMediaKeysUI.Util +{ + internal static class ColorUtil + { + public static double DwmBrightness(DwmColor c) + { + return Math.Sqrt( + c.R * c.R * .241 + + c.G * c.G * .691 + + c.B * c.B * .068 + ); + } + } +} diff --git a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/VirtualMediaKeysUI.csproj b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/VirtualMediaKeysUI.csproj index 72d7679..b770e9c 100644 --- a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/VirtualMediaKeysUI.csproj +++ b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/VirtualMediaKeysUI.csproj @@ -16,7 +16,7 @@ true - AnyCPU + x64 true full false @@ -26,7 +26,7 @@ 4 - AnyCPU + x64 pdbonly true bin\Release\ @@ -35,6 +35,9 @@ 4 + + ..\packages\Microsoft.Windows.Shell.3.0.1.0\lib\net40\Microsoft.Windows.Shell.dll + @@ -55,6 +58,7 @@ MSBuild:Compile Designer + MSBuild:Compile Designer @@ -69,6 +73,8 @@ + + Code @@ -86,6 +92,7 @@ ResXFileCodeGenerator Resources.Designer.cs + SettingsSingleFileGenerator Settings.Designer.cs diff --git a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/packages.config b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/packages.config new file mode 100644 index 0000000..3670601 --- /dev/null +++ b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file From da995ef6c0ee434beb627ddaca4c992dc12dd16f Mon Sep 17 00:00:00 2001 From: Paul Date: Sun, 23 Sep 2018 03:35:53 -0400 Subject: [PATCH 4/9] Add handlers --- .../VirtualMediaKeysUI/MainWindow.xaml | 47 +- .../VirtualMediaKeysUI/MainWindow.xaml.cs | 30 + .../VirtualMediaKeysUI/Native/Input.cs | 741 ++++++++++++++++++ .../VirtualMediaKeysUI.csproj | 1 + 4 files changed, 811 insertions(+), 8 deletions(-) create mode 100644 src/VirtualMediaKeysUI/VirtualMediaKeysUI/Native/Input.cs diff --git a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/MainWindow.xaml b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/MainWindow.xaml index c5f6657..93dffee 100644 --- a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/MainWindow.xaml +++ b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/MainWindow.xaml @@ -30,6 +30,28 @@ + + + + + + #FF333333 @@ -105,6 +127,9 @@ + @@ -115,47 +140,53 @@ - - - - - - + diff --git a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/MainWindow.xaml.cs b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/MainWindow.xaml.cs index 10b0832..9036804 100644 --- a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/MainWindow.xaml.cs +++ b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/MainWindow.xaml.cs @@ -84,5 +84,35 @@ private void Close_Click(object sender, RoutedEventArgs e) { Close(); } + + private void Previous_Click(object sender, RoutedEventArgs e) + { + Input.SendKeyPress(Input.KeyCode.MEDIA_PREV_TRACK); + } + + private void Pause_Click(object sender, RoutedEventArgs e) + { + Input.SendKeyPress(Input.KeyCode.MEDIA_PLAY_PAUSE); + } + + private void Next_Click(object sender, RoutedEventArgs e) + { + Input.SendKeyPress(Input.KeyCode.MEDIA_NEXT_TRACK); + } + + private void VolumeDown_Click(object sender, RoutedEventArgs e) + { + Input.SendKeyPress(Input.KeyCode.VOLUME_DOWN); + } + + private void VolumeMute_Click(object sender, RoutedEventArgs e) + { + Input.SendKeyPress(Input.KeyCode.VOLUME_MUTE); + } + + private void VolumeUp_Click(object sender, RoutedEventArgs e) + { + Input.SendKeyPress(Input.KeyCode.VOLUME_UP); + } } } diff --git a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/Native/Input.cs b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/Native/Input.cs new file mode 100644 index 0000000..baa9039 --- /dev/null +++ b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/Native/Input.cs @@ -0,0 +1,741 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace VirtualMediaKeysUI.Native +{ + internal class Input + { + [DllImport("user32.dll", SetLastError = true)] + private static extern uint SendInput(uint numberOfInputs, INPUT[] inputs, int sizeOfInputStructure); + + internal const int KEYEVENTF_KEYUP = 2; + + /// + /// simulate key press + /// + /// + public static void SendKeyPress(KeyCode keyCode) + { + INPUT input = new INPUT + { + Type = INPUT_TYPE.INPUT_KEYBOARD, + }; + input.Data.Keyboard = new KEYBDINPUT() + { + Vk = (ushort)keyCode, + Scan = 0, + Flags = 0, + Time = 0, + ExtraInfo = IntPtr.Zero, + }; + + INPUT input2 = new INPUT + { + Type = INPUT_TYPE.INPUT_KEYBOARD, + }; + input2.Data.Keyboard = new KEYBDINPUT() + { + Vk = (ushort)keyCode, + Scan = 0, + Flags = KEYEVENTF_KEYUP, + Time = 0, + ExtraInfo = IntPtr.Zero + }; + INPUT[] inputs = new INPUT[] { input, input2 }; + if (SendInput(2, inputs, Marshal.SizeOf(typeof(INPUT))) == 0) + throw new Exception(); + } + + internal enum INPUT_TYPE : uint + { + INPUT_MOUSE = 0, + INPUT_KEYBOARD = 1, + INPUT_HARDWARE = 2 + } + + /// + /// http://msdn.microsoft.com/en-us/library/windows/desktop/ms646270(v=vs.85).aspx + /// + [StructLayout(LayoutKind.Sequential)] + internal struct INPUT + { + public INPUT_TYPE Type; + public MOUSEKEYBDHARDWAREINPUT Data; + } + + /// + /// http://social.msdn.microsoft.com/Forums/en/csharplanguage/thread/f0e82d6e-4999-4d22-b3d3-32b25f61fb2a + /// + [StructLayout(LayoutKind.Explicit)] + internal struct MOUSEKEYBDHARDWAREINPUT + { + [FieldOffset(0)] + public HARDWAREINPUT Hardware; + [FieldOffset(0)] + public KEYBDINPUT Keyboard; + [FieldOffset(0)] + public MOUSEINPUT Mouse; + } + + /// + /// http://msdn.microsoft.com/en-us/library/windows/desktop/ms646310(v=vs.85).aspx + /// + [StructLayout(LayoutKind.Sequential)] + internal struct HARDWAREINPUT + { + public uint Msg; + public ushort ParamL; + public ushort ParamH; + } + + /// + /// http://msdn.microsoft.com/en-us/library/windows/desktop/ms646310(v=vs.85).aspx + /// + [StructLayout(LayoutKind.Sequential)] + internal struct KEYBDINPUT + { + public ushort Vk; + public ushort Scan; + public uint Flags; + public uint Time; + public IntPtr ExtraInfo; + } + + /// + /// http://social.msdn.microsoft.com/forums/en-US/netfxbcl/thread/2abc6be8-c593-4686-93d2-89785232dacd + /// + [StructLayout(LayoutKind.Sequential)] + internal struct MOUSEINPUT + { + public int X; + public int Y; + public uint MouseData; + public uint Flags; + public uint Time; + public IntPtr ExtraInfo; + } + + public enum KeyCode : ushort + { + #region Media + + /// + /// Next track if a song is playing + /// + MEDIA_NEXT_TRACK = 0xb0, + + /// + /// Play pause + /// + MEDIA_PLAY_PAUSE = 0xb3, + + /// + /// Previous track + /// + MEDIA_PREV_TRACK = 0xb1, + + /// + /// Stop + /// + MEDIA_STOP = 0xb2, + + #endregion + + #region math + + /// Key "+" + ADD = 0x6b, + /// + /// "*" key + /// + MULTIPLY = 0x6a, + + /// + /// "/" key + /// + DIVIDE = 0x6f, + + /// + /// Subtract key "-" + /// + SUBTRACT = 0x6d, + + #endregion + + #region Browser + /// + /// Go Back + /// + BROWSER_BACK = 0xa6, + /// + /// Favorites + /// + BROWSER_FAVORITES = 0xab, + /// + /// Forward + /// + BROWSER_FORWARD = 0xa7, + /// + /// Home + /// + BROWSER_HOME = 0xac, + /// + /// Refresh + /// + BROWSER_REFRESH = 0xa8, + /// + /// browser search + /// + BROWSER_SEARCH = 170, + /// + /// Stop + /// + BROWSER_STOP = 0xa9, + #endregion + + #region Numpad numbers + /// + /// + /// + NUMPAD0 = 0x60, + /// + /// + /// + NUMPAD1 = 0x61, + /// + /// + /// + NUMPAD2 = 0x62, + /// + /// + /// + NUMPAD3 = 0x63, + /// + /// + /// + NUMPAD4 = 100, + /// + /// + /// + NUMPAD5 = 0x65, + /// + /// + /// + NUMPAD6 = 0x66, + /// + /// + /// + NUMPAD7 = 0x67, + /// + /// + /// + NUMPAD8 = 0x68, + /// + /// + /// + NUMPAD9 = 0x69, + + #endregion + + #region Fkeys + /// + /// F1 + /// + F1 = 0x70, + /// + /// F10 + /// + F10 = 0x79, + /// + /// + /// + F11 = 0x7a, + /// + /// + /// + F12 = 0x7b, + /// + /// + /// + F13 = 0x7c, + /// + /// + /// + F14 = 0x7d, + /// + /// + /// + F15 = 0x7e, + /// + /// + /// + F16 = 0x7f, + /// + /// + /// + F17 = 0x80, + /// + /// + /// + F18 = 0x81, + /// + /// + /// + F19 = 130, + /// + /// + /// + F2 = 0x71, + /// + /// + /// + F20 = 0x83, + /// + /// + /// + F21 = 0x84, + /// + /// + /// + F22 = 0x85, + /// + /// + /// + F23 = 0x86, + /// + /// + /// + F24 = 0x87, + /// + /// + /// + F3 = 0x72, + /// + /// + /// + F4 = 0x73, + /// + /// + /// + F5 = 0x74, + /// + /// + /// + F6 = 0x75, + /// + /// + /// + F7 = 0x76, + /// + /// + /// + F8 = 0x77, + /// + /// + /// + F9 = 120, + + #endregion + + #region Other + /// + /// + /// + OEM_1 = 0xba, + /// + /// + /// + OEM_102 = 0xe2, + /// + /// + /// + OEM_2 = 0xbf, + /// + /// + /// + OEM_3 = 0xc0, + /// + /// + /// + OEM_4 = 0xdb, + /// + /// + /// + OEM_5 = 220, + /// + /// + /// + OEM_6 = 0xdd, + /// + /// + /// + OEM_7 = 0xde, + /// + /// + /// + OEM_8 = 0xdf, + /// + /// + /// + OEM_CLEAR = 0xfe, + /// + /// + /// + OEM_COMMA = 0xbc, + /// + /// + /// + OEM_MINUS = 0xbd, + /// + /// + /// + OEM_PERIOD = 190, + /// + /// + /// + OEM_PLUS = 0xbb, + + #endregion + + #region KEYS + + /// + /// + /// + KEY_0 = 0x30, + /// + /// + /// + KEY_1 = 0x31, + /// + /// + /// + KEY_2 = 50, + /// + /// + /// + KEY_3 = 0x33, + /// + /// + /// + KEY_4 = 0x34, + /// + /// + /// + KEY_5 = 0x35, + /// + /// + /// + KEY_6 = 0x36, + /// + /// + /// + KEY_7 = 0x37, + /// + /// + /// + KEY_8 = 0x38, + /// + /// + /// + KEY_9 = 0x39, + /// + /// + /// + KEY_A = 0x41, + /// + /// + /// + KEY_B = 0x42, + /// + /// + /// + KEY_C = 0x43, + /// + /// + /// + KEY_D = 0x44, + /// + /// + /// + KEY_E = 0x45, + /// + /// + /// + KEY_F = 70, + /// + /// + /// + KEY_G = 0x47, + /// + /// + /// + KEY_H = 0x48, + /// + /// + /// + KEY_I = 0x49, + /// + /// + /// + KEY_J = 0x4a, + /// + /// + /// + KEY_K = 0x4b, + /// + /// + /// + KEY_L = 0x4c, + /// + /// + /// + KEY_M = 0x4d, + /// + /// + /// + KEY_N = 0x4e, + /// + /// + /// + KEY_O = 0x4f, + /// + /// + /// + KEY_P = 80, + /// + /// + /// + KEY_Q = 0x51, + /// + /// + /// + KEY_R = 0x52, + /// + /// + /// + KEY_S = 0x53, + /// + /// + /// + KEY_T = 0x54, + /// + /// + /// + KEY_U = 0x55, + /// + /// + /// + KEY_V = 0x56, + /// + /// + /// + KEY_W = 0x57, + /// + /// + /// + KEY_X = 0x58, + /// + /// + /// + KEY_Y = 0x59, + /// + /// + /// + KEY_Z = 90, + + #endregion + + #region volume + /// + /// Decrese volume + /// + VOLUME_DOWN = 0xae, + + /// + /// Mute volume + /// + VOLUME_MUTE = 0xad, + + /// + /// Increase volue + /// + VOLUME_UP = 0xaf, + + #endregion + + + /// + /// Take snapshot of the screen and place it on the clipboard + /// + SNAPSHOT = 0x2c, + + /// Send right click from keyboard "key that is 2 keys to the right of space bar" + RightClick = 0x5d, + + /// + /// Go Back or delete + /// + BACKSPACE = 8, + + /// + /// Control + Break "When debuging if you step into an infinite loop this will stop debug" + /// + CANCEL = 3, + /// + /// Caps lock key to send cappital letters + /// + CAPS_LOCK = 20, + /// + /// Ctlr key + /// + CONTROL = 0x11, + + /// + /// Alt key + /// + ALT = 18, + + /// + /// "." key + /// + DECIMAL = 110, + + /// + /// Delete Key + /// + DELETE = 0x2e, + + + /// + /// Arrow down key + /// + DOWN = 40, + + /// + /// End key + /// + END = 0x23, + + /// + /// Escape key + /// + ESC = 0x1b, + + /// + /// Home key + /// + HOME = 0x24, + + /// + /// Insert key + /// + INSERT = 0x2d, + + /// + /// Open my computer + /// + LAUNCH_APP1 = 0xb6, + /// + /// Open calculator + /// + LAUNCH_APP2 = 0xb7, + + /// + /// Open default email in my case outlook + /// + LAUNCH_MAIL = 180, + + /// + /// Opend default media player (itunes, winmediaplayer, etc) + /// + LAUNCH_MEDIA_SELECT = 0xb5, + + /// + /// Left control + /// + LCONTROL = 0xa2, + + /// + /// Left arrow + /// + LEFT = 0x25, + + /// + /// Left shift + /// + LSHIFT = 160, + + /// + /// left windows key + /// + LWIN = 0x5b, + + + /// + /// Next "page down" + /// + PAGEDOWN = 0x22, + + /// + /// Num lock to enable typing numbers + /// + NUMLOCK = 0x90, + + /// + /// Page up key + /// + PAGE_UP = 0x21, + + /// + /// Right control + /// + RCONTROL = 0xa3, + + /// + /// Return key + /// + ENTER = 13, + + /// + /// Right arrow key + /// + RIGHT = 0x27, + + /// + /// Right shift + /// + RSHIFT = 0xa1, + + /// + /// Right windows key + /// + RWIN = 0x5c, + + /// + /// Shift key + /// + SHIFT = 0x10, + + /// + /// Space back key + /// + SPACE_BAR = 0x20, + + /// + /// Tab key + /// + TAB = 9, + + /// + /// Up arrow key + /// + UP = 0x26, + + } + } +} diff --git a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/VirtualMediaKeysUI.csproj b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/VirtualMediaKeysUI.csproj index b770e9c..7f086c2 100644 --- a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/VirtualMediaKeysUI.csproj +++ b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/VirtualMediaKeysUI.csproj @@ -58,6 +58,7 @@ MSBuild:Compile Designer + MSBuild:Compile From 6b83b70779622ffb0da9ae92c6ce4c51e19cef57 Mon Sep 17 00:00:00 2001 From: Paul Date: Sun, 23 Sep 2018 03:38:51 -0400 Subject: [PATCH 5/9] Update assembly info --- .../VirtualMediaKeysUI/Properties/AssemblyInfo.cs | 14 +++++++------- .../VirtualMediaKeysUI/VirtualMediaKeysUI.csproj | 8 ++++++++ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/Properties/AssemblyInfo.cs b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/Properties/AssemblyInfo.cs index 0cc94bb..1ed580b 100644 --- a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/Properties/AssemblyInfo.cs +++ b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/Properties/AssemblyInfo.cs @@ -7,12 +7,12 @@ // 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("VirtualMediaKeysUI")] -[assembly: AssemblyDescription("")] +[assembly: AssemblyTitle("Virtual Media Keys")] +[assembly: AssemblyDescription("UI for onscreen virtual media keys.")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("VirtualMediaKeysUI")] -[assembly: AssemblyCopyright("Copyright © 2018")] +[assembly: AssemblyCompany("pvdstel")] +[assembly: AssemblyProduct("Virtual Media Keys UI")] +[assembly: AssemblyCopyright("Copyright © pvdstel 2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -51,5 +51,5 @@ // 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("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("0.0.1.0")] +[assembly: AssemblyFileVersion("0.0.1.0")] diff --git a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/VirtualMediaKeysUI.csproj b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/VirtualMediaKeysUI.csproj index 7f086c2..53b5f27 100644 --- a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/VirtualMediaKeysUI.csproj +++ b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/VirtualMediaKeysUI.csproj @@ -34,6 +34,9 @@ prompt 4 + + ..\..\..\icon\ico\AppIcon.ico + ..\packages\Microsoft.Windows.Shell.3.0.1.0\lib\net40\Microsoft.Windows.Shell.dll @@ -102,5 +105,10 @@ + + + AppIcon.ico + + \ No newline at end of file From 4bcf8adf4355ba6191f2b5de1d7b142c881b4628 Mon Sep 17 00:00:00 2001 From: Paul Date: Sun, 23 Sep 2018 03:41:02 -0400 Subject: [PATCH 6/9] Add icon to main window --- src/VirtualMediaKeysUI/VirtualMediaKeysUI/MainWindow.xaml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/MainWindow.xaml b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/MainWindow.xaml index 93dffee..fd11354 100644 --- a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/MainWindow.xaml +++ b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/MainWindow.xaml @@ -10,6 +10,7 @@ Width="200" Height="150" Background="{DynamicResource AccentColor}" + Icon="/VirtualMediaKeysUI;component/AppIcon.ico" ShowActivated="False" SourceInitialized="Window_SourceInitialized" Topmost="True" From 0fbed2d06a9305842719d09853d9b576a27e4e8a Mon Sep 17 00:00:00 2001 From: Paul Date: Sun, 23 Sep 2018 03:46:20 -0400 Subject: [PATCH 7/9] Add Fody Costura --- .../VirtualMediaKeysUI/FodyWeavers.xml | 3 +++ .../VirtualMediaKeysUI/VirtualMediaKeysUI.csproj | 14 ++++++++++++++ .../VirtualMediaKeysUI/packages.config | 2 ++ 3 files changed, 19 insertions(+) create mode 100644 src/VirtualMediaKeysUI/VirtualMediaKeysUI/FodyWeavers.xml diff --git a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/FodyWeavers.xml b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/FodyWeavers.xml new file mode 100644 index 0000000..9043189 --- /dev/null +++ b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/VirtualMediaKeysUI.csproj b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/VirtualMediaKeysUI.csproj index 53b5f27..e9ffe92 100644 --- a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/VirtualMediaKeysUI.csproj +++ b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/VirtualMediaKeysUI.csproj @@ -14,6 +14,8 @@ 4 true true + + x64 @@ -38,6 +40,9 @@ ..\..\..\icon\ico\AppIcon.ico + + ..\packages\Costura.Fody.3.1.2\lib\net46\Costura.dll + ..\packages\Microsoft.Windows.Shell.3.0.1.0\lib\net40\Microsoft.Windows.Shell.dll @@ -111,4 +116,13 @@ + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + \ No newline at end of file diff --git a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/packages.config b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/packages.config index 3670601..a3793de 100644 --- a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/packages.config +++ b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/packages.config @@ -1,4 +1,6 @@  + + \ No newline at end of file From 101bbc3c79a7340e4c06411f4eaca28e22007b8a Mon Sep 17 00:00:00 2001 From: Paul Date: Sun, 23 Sep 2018 03:48:51 -0400 Subject: [PATCH 8/9] Make XML valid --- src/VirtualMediaKeysUI/VirtualMediaKeysUI/FodyWeavers.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/FodyWeavers.xml b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/FodyWeavers.xml index 9043189..43fc6a6 100644 --- a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/FodyWeavers.xml +++ b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/FodyWeavers.xml @@ -1,3 +1,4 @@ + \ No newline at end of file From 9b795a21b0127b0f55a80e03ec5899408e9685b5 Mon Sep 17 00:00:00 2001 From: Paul Date: Sun, 23 Sep 2018 03:53:17 -0400 Subject: [PATCH 9/9] Change product title --- .../VirtualMediaKeysUI/Properties/AssemblyInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/Properties/AssemblyInfo.cs b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/Properties/AssemblyInfo.cs index 1ed580b..de8b741 100644 --- a/src/VirtualMediaKeysUI/VirtualMediaKeysUI/Properties/AssemblyInfo.cs +++ b/src/VirtualMediaKeysUI/VirtualMediaKeysUI/Properties/AssemblyInfo.cs @@ -7,7 +7,7 @@ // 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("Virtual Media Keys")] +[assembly: AssemblyTitle("Virtual Media Keys UI")] [assembly: AssemblyDescription("UI for onscreen virtual media keys.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("pvdstel")]