windows10 update: fix display name variation in rdp session; fix hang in call to SetWindowsPosition for "CodeSetup*"

This commit is contained in:
kangyu 2019-12-21 18:27:25 -08:00
parent edeb86a1f2
commit 67b801370b
12 changed files with 198 additions and 49 deletions

View file

@ -70,15 +70,17 @@ namespace Ninjacrab.PersistentWindows.Common.Diagnostics
public static void Info(string format, params object[] args) public static void Info(string format, params object[] args)
{ {
/*
var message = Format(format, args); var message = Format(format, args);
Logger.Info(Format(format, args)); Logger.Info(message);
RaiseLogEvent(LogLevel.Info, message); RaiseLogEvent(LogLevel.Info, message);
*/
} }
public static void Error(string format, params object[] args) public static void Error(string format, params object[] args)
{ {
var message = Format(format, args); var message = Format(format, args);
Logger.Error(Format(format, args)); Logger.Error(message);
RaiseLogEvent(LogLevel.Error, message); RaiseLogEvent(LogLevel.Error, message);
} }

View file

@ -32,12 +32,35 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Deploy|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Deploy|AnyCPU'">
<OutputPath>bin\Deploy\</OutputPath> <OutputPath>bin\Deploy\</OutputPath>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Deploy|x64'">
<OutputPath>bin\x64\Deploy\</OutputPath>
<PlatformTarget>x64</PlatformTarget>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="ManagedWinapi"> <Reference Include="ManagedWinapi">
<HintPath>..\packages\ManagedWinapi.0.3\ManagedWinapi.dll</HintPath> <HintPath>..\packages\ManagedWinapi.0.3\ManagedWinapi.dll</HintPath>
</Reference> </Reference>
<Reference Include="NLog"> <Reference Include="Microsoft.QualityTools.Testing.Fakes, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.3.2.0.0\lib\net45\NLog.dll</HintPath> <SpecificVersion>False</SpecificVersion>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
@ -65,7 +88,9 @@
<Compile Include="WinApiBridge\WindowsPosition.cs" /> <Compile Include="WinApiBridge\WindowsPosition.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="packages.config" /> <PackageReference Include="NLog">
<Version>4.6.8</Version>
</PackageReference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View file

@ -4,6 +4,7 @@ using System.ComponentModel;
using System.Linq; using System.Linq;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Threading; using System.Threading;
using ManagedWinapi;
using ManagedWinapi.Hooks; using ManagedWinapi.Hooks;
using ManagedWinapi.Windows; using ManagedWinapi.Windows;
using Microsoft.Win32; using Microsoft.Win32;
@ -19,10 +20,14 @@ namespace Ninjacrab.PersistentWindows.Common
private int AppsMovedThreshold = 4; private int AppsMovedThreshold = 4;
private DesktopDisplayMetrics lastMetrics = null; private DesktopDisplayMetrics lastMetrics = null;
private Hook windowProcHook; private Hook windowProcHook;
private Dictionary<string, SortedDictionary<string, ApplicationDisplayMetrics>> monitorApplications = null;
private object displayChangeLock = null;
public void Start() public void Start()
{ {
lastMetrics = DesktopDisplayMetrics.AcquireMetrics(); lastMetrics = DesktopDisplayMetrics.AcquireMetrics();
monitorApplications = new Dictionary<string, SortedDictionary<string, ApplicationDisplayMetrics>>();
displayChangeLock = new object();
CaptureApplicationsOnCurrentDisplays(initialCapture: true); CaptureApplicationsOnCurrentDisplays(initialCapture: true);
var thread = new Thread(InternalRun); var thread = new Thread(InternalRun);
@ -51,10 +56,12 @@ namespace Ninjacrab.PersistentWindows.Common
} }
}; };
//windowProcHook = new Hook(); /*
//windowProcHook.Type = HookType.WH_CALLWNDPROC; windowProcHook = new Hook();
//windowProcHook.Callback += GlobalWindowProcCallback; windowProcHook.Type = HookType.WH_CALLWNDPROC;
//windowProcHook.StartHook(); windowProcHook.Callback += GlobalWindowProcCallback;
windowProcHook.StartHook();
*/
} }
int GlobalWindowProcCallback(int code, IntPtr wParam, IntPtr lParam, ref bool callNext) int GlobalWindowProcCallback(int code, IntPtr wParam, IntPtr lParam, ref bool callNext)
@ -161,7 +168,7 @@ namespace Ninjacrab.PersistentWindows.Common
var key = appMetrics.Key; var key = appMetrics.Key;
if (monitorApplications[lastMetrics.Key].ContainsKey(key)) if (monitorApplications[lastMetrics.Key].ContainsKey(key))
{ {
monitorApplications[lastMetrics.Key][appMetrics.Key].WindowPlacement = windowPlacement; monitorApplications[lastMetrics.Key][key].WindowPlacement = windowPlacement;
} }
else else
{ {
@ -178,15 +185,12 @@ namespace Ninjacrab.PersistentWindows.Common
); );
} }
private readonly Dictionary<string, SortedDictionary<string, ApplicationDisplayMetrics>> monitorApplications = new Dictionary<string, SortedDictionary<string, ApplicationDisplayMetrics>>();
private readonly object displayChangeLock = new object();
private void InternalRun() private void InternalRun()
{ {
while(true) while(true)
{ {
Thread.Sleep(1500);
CaptureApplicationsOnCurrentDisplays(); CaptureApplicationsOnCurrentDisplays();
Thread.Sleep(1000);
} }
} }
@ -245,8 +249,7 @@ namespace Ninjacrab.PersistentWindows.Common
} }
// only save the updated if it didn't seem like something moved everything // only save the updated if it didn't seem like something moved everything
if ((apps.Count > 0 if ((apps.Count > 0 && apps.Count < AppsMovedThreshold)
&& apps.Count < AppsMovedThreshold)
|| initialCapture) || initialCapture)
{ {
foreach(var app in apps) foreach(var app in apps)
@ -272,7 +275,7 @@ namespace Ninjacrab.PersistentWindows.Common
return SystemWindow.AllToplevelWindows return SystemWindow.AllToplevelWindows
.Where(row => row.Parent.HWnd.ToInt64() == 0 .Where(row => row.Parent.HWnd.ToInt64() == 0
&& !string.IsNullOrEmpty(row.Title) && !string.IsNullOrEmpty(row.Title)
&& !row.Title.Equals("Program Manager") && !row.Title.Equals("Task Manager")
&& row.Visible); && row.Visible);
} }
@ -289,8 +292,10 @@ namespace Ninjacrab.PersistentWindows.Common
applicationDisplayMetric = new ApplicationDisplayMetrics applicationDisplayMetric = new ApplicationDisplayMetrics
{ {
HWnd = window.HWnd, HWnd = window.HWnd,
ApplicationName = window.Process.ProcessName, //ApplicationName = window.Process.ProcessName,
ProcessId = window.Process.Id, ApplicationName = "..",
//ProcessId = window.Process.Id,
ProcessId = 0,
WindowPlacement = windowPlacement WindowPlacement = windowPlacement
}; };
@ -334,23 +339,36 @@ namespace Ninjacrab.PersistentWindows.Common
displayKey = metrics.Key; displayKey = metrics.Key;
} }
lastMetrics = DesktopDisplayMetrics.AcquireMetrics(); /// lastMetrics = DesktopDisplayMetrics.AcquireMetrics();
if (!monitorApplications.ContainsKey(displayKey)) if (!monitorApplications.ContainsKey(displayKey))
{ {
// no old profile, we're done // no old profile, we're done
Log.Info("No old profile found for {0}", displayKey); Log.Trace("No old profile found for {0}", displayKey);
CaptureApplicationsOnCurrentDisplays(initialCapture: true); /// CaptureApplicationsOnCurrentDisplays(initialCapture: true);
return; return;
} }
Log.Info("Restoring applications for {0}", displayKey); Log.Info("Restoring applications for {0}", displayKey);
foreach (var window in CaptureWindowsOfInterest()) foreach (var window in CaptureWindowsOfInterest())
{ {
string applicationKey = string.Format("{0}-{1}", window.HWnd.ToInt64(), window.Process.ProcessName); var proc_name = window.Process.ProcessName;
if (proc_name.Contains("CodeSetup"))
{
// prevent hang in SetWindowPlacement()
continue;
}
//string applicationKey = string.Format("{0}-{1}", window.HWnd.ToInt64(), window.Process.ProcessName);
string applicationKey = string.Format("{0}-{1}", window.HWnd.ToInt64(), "..");
if (monitorApplications[displayKey].ContainsKey(applicationKey)) if (monitorApplications[displayKey].ContainsKey(applicationKey))
{ {
// looks like the window is still here for us to restore // looks like the window is still here for us to restore
WindowPlacement windowPlacement = monitorApplications[displayKey][applicationKey].WindowPlacement; WindowPlacement windowPlacement = monitorApplications[displayKey][applicationKey].WindowPlacement;
IntPtr hwnd = monitorApplications[displayKey][applicationKey].HWnd;
if (!User32.IsWindow(hwnd))
{
continue;
}
if (windowPlacement.ShowCmd == ShowWindowCommands.Maximize) if (windowPlacement.ShowCmd == ShowWindowCommands.Maximize)
{ {
@ -358,11 +376,12 @@ namespace Ninjacrab.PersistentWindows.Common
// the window thinks it's maxxed, but does not eat all the real estate. So we'll temporarily unmaximize then // the window thinks it's maxxed, but does not eat all the real estate. So we'll temporarily unmaximize then
// re-apply that // re-apply that
windowPlacement.ShowCmd = ShowWindowCommands.Normal; windowPlacement.ShowCmd = ShowWindowCommands.Normal;
User32.SetWindowPlacement(monitorApplications[displayKey][applicationKey].HWnd, ref windowPlacement); User32.SetWindowPlacement(hwnd, ref windowPlacement);
windowPlacement.ShowCmd = ShowWindowCommands.Maximize; windowPlacement.ShowCmd = ShowWindowCommands.Maximize;
} }
var success = User32.SetWindowPlacement(monitorApplications[displayKey][applicationKey].HWnd, ref windowPlacement); var success = User32.SetWindowPlacement(monitorApplications[displayKey][applicationKey].HWnd, ref windowPlacement);
if(!success) if (!success)
{ {
string error = new Win32Exception(Marshal.GetLastWin32Error()).Message; string error = new Win32Exception(Marshal.GetLastWin32Error()).Message;
Log.Error(error); Log.Error(error);

View file

@ -33,8 +33,9 @@ namespace Ninjacrab.PersistentWindows.Common.WinApiBridge
display.Top = monitorInfo.Monitor.Top; display.Top = monitorInfo.Monitor.Top;
display.Flags = monitorInfo.Flags; display.Flags = monitorInfo.Flags;
int pos = monitorInfo.DeviceName.LastIndexOf("\\") + 1; //int pos = monitorInfo.DeviceName.LastIndexOf("\\") + 1;
display.DeviceName = monitorInfo.DeviceName.Substring(pos, monitorInfo.DeviceName.Length - pos); //display.DeviceName = monitorInfo.DeviceName.Substring(pos, monitorInfo.DeviceName.Length - pos);
display.DeviceName = "Display";
displays.Add(display); displays.Add(display);
} }

View file

@ -27,6 +27,10 @@ namespace Ninjacrab.PersistentWindows.Common.WinApiBridge
[return: MarshalAs(UnmanagedType.Bool)] [return: MarshalAs(UnmanagedType.Bool)]
public static extern bool SetWindowPlacement(IntPtr hWnd, [In] ref WindowPlacement lpwndpl); public static extern bool SetWindowPlacement(IntPtr hWnd, [In] ref WindowPlacement lpwndpl);
[DllImport("user32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool IsWindow(IntPtr hWnd);
#region Hooks #region Hooks
[DllImport("user32.dll")] [DllImport("user32.dll")]
public static extern IntPtr CallNextHookEx(IntPtr hhk, int nCode, IntPtr wParam, IntPtr lParam); public static extern IntPtr CallNextHookEx(IntPtr hhk, int nCode, IntPtr wParam, IntPtr lParam);

View file

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="NLog" version="3.2.0.0" targetFramework="net45" /> <package id="NLog" version="4.6.8.0" targetFramework="net45" />
</packages> </packages>

View file

@ -1,7 +1,7 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013 # Visual Studio 15
VisualStudioVersion = 12.0.31101.0 VisualStudioVersion = 15.0.28307.960
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ninjacrab.PersistentWindows.WpfShell", "Ninjacrab.PersistentWindows.WpfShell\Ninjacrab.PersistentWindows.WpfShell.csproj", "{4EA12EC8-B50F-4DEA-AA7D-85A5F4C81F83}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ninjacrab.PersistentWindows.WpfShell", "Ninjacrab.PersistentWindows.WpfShell\Ninjacrab.PersistentWindows.WpfShell.csproj", "{4EA12EC8-B50F-4DEA-AA7D-85A5F4C81F83}"
EndProject EndProject
@ -17,23 +17,40 @@ EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4EA12EC8-B50F-4DEA-AA7D-85A5F4C81F83}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4EA12EC8-B50F-4DEA-AA7D-85A5F4C81F83}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4EA12EC8-B50F-4DEA-AA7D-85A5F4C81F83}.Debug|Any CPU.Build.0 = Debug|Any CPU {4EA12EC8-B50F-4DEA-AA7D-85A5F4C81F83}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4EA12EC8-B50F-4DEA-AA7D-85A5F4C81F83}.Debug|x64.ActiveCfg = Debug|x64
{4EA12EC8-B50F-4DEA-AA7D-85A5F4C81F83}.Debug|x64.Build.0 = Debug|x64
{4EA12EC8-B50F-4DEA-AA7D-85A5F4C81F83}.Release|Any CPU.ActiveCfg = Release|Any CPU {4EA12EC8-B50F-4DEA-AA7D-85A5F4C81F83}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4EA12EC8-B50F-4DEA-AA7D-85A5F4C81F83}.Release|Any CPU.Build.0 = Release|Any CPU {4EA12EC8-B50F-4DEA-AA7D-85A5F4C81F83}.Release|Any CPU.Build.0 = Release|Any CPU
{4EA12EC8-B50F-4DEA-AA7D-85A5F4C81F83}.Release|x64.ActiveCfg = Release|x64
{4EA12EC8-B50F-4DEA-AA7D-85A5F4C81F83}.Release|x64.Build.0 = Release|x64
{4CC8B3FB-214B-42AB-8AAE-E7DC5E266EF0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4CC8B3FB-214B-42AB-8AAE-E7DC5E266EF0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4CC8B3FB-214B-42AB-8AAE-E7DC5E266EF0}.Debug|Any CPU.Build.0 = Debug|Any CPU {4CC8B3FB-214B-42AB-8AAE-E7DC5E266EF0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4CC8B3FB-214B-42AB-8AAE-E7DC5E266EF0}.Debug|x64.ActiveCfg = Debug|x64
{4CC8B3FB-214B-42AB-8AAE-E7DC5E266EF0}.Debug|x64.Build.0 = Debug|x64
{4CC8B3FB-214B-42AB-8AAE-E7DC5E266EF0}.Release|Any CPU.ActiveCfg = Release|Any CPU {4CC8B3FB-214B-42AB-8AAE-E7DC5E266EF0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4CC8B3FB-214B-42AB-8AAE-E7DC5E266EF0}.Release|Any CPU.Build.0 = Release|Any CPU {4CC8B3FB-214B-42AB-8AAE-E7DC5E266EF0}.Release|Any CPU.Build.0 = Release|Any CPU
{4CC8B3FB-214B-42AB-8AAE-E7DC5E266EF0}.Release|x64.ActiveCfg = Release|x64
{4CC8B3FB-214B-42AB-8AAE-E7DC5E266EF0}.Release|x64.Build.0 = Release|x64
{A728279C-F567-4E54-8BC6-90A66DC3EF57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A728279C-F567-4E54-8BC6-90A66DC3EF57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A728279C-F567-4E54-8BC6-90A66DC3EF57}.Debug|Any CPU.Build.0 = Debug|Any CPU {A728279C-F567-4E54-8BC6-90A66DC3EF57}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A728279C-F567-4E54-8BC6-90A66DC3EF57}.Debug|x64.ActiveCfg = Debug|x64
{A728279C-F567-4E54-8BC6-90A66DC3EF57}.Debug|x64.Build.0 = Debug|x64
{A728279C-F567-4E54-8BC6-90A66DC3EF57}.Release|Any CPU.ActiveCfg = Release|Any CPU {A728279C-F567-4E54-8BC6-90A66DC3EF57}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A728279C-F567-4E54-8BC6-90A66DC3EF57}.Release|Any CPU.Build.0 = Release|Any CPU {A728279C-F567-4E54-8BC6-90A66DC3EF57}.Release|Any CPU.Build.0 = Release|Any CPU
{A728279C-F567-4E54-8BC6-90A66DC3EF57}.Release|x64.ActiveCfg = Release|x64
{A728279C-F567-4E54-8BC6-90A66DC3EF57}.Release|x64.Build.0 = Release|x64
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B8B22310-35AA-4C5E-9ADA-7C88521554BF}
EndGlobalSection
EndGlobal EndGlobal

View file

@ -1,6 +1,22 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup> </startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Practices.Prism.PubSubEvents" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Practices.ServiceLocation" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.3.0.0" newVersion="1.3.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Practices.Prism.SharedInterfaces" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.1.1.0" newVersion="1.1.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration> </configuration>

View file

@ -11,6 +11,21 @@
<AssemblyName>PersistentWindows</AssemblyName> <AssemblyName>PersistentWindows</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
@ -35,6 +50,25 @@
<PropertyGroup> <PropertyGroup>
<ApplicationIcon>..\Resources\Oxygen-Icons.org-Oxygen-Status-media-playlist-repeat.ico</ApplicationIcon> <ApplicationIcon>..\Resources\Oxygen-Icons.org-Oxygen-Status-media-playlist-repeat.ico</ApplicationIcon>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="PresentationCore" /> <Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" /> <Reference Include="PresentationFramework" />
@ -83,7 +117,9 @@
</Compile> </Compile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="App.config" /> <None Include="App.config">
<SubType>Designer</SubType>
</None>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Ninjacrab.PersistentWindows.Common\Ninjacrab.PersistentWindows.Common.csproj"> <ProjectReference Include="..\Ninjacrab.PersistentWindows.Common\Ninjacrab.PersistentWindows.Common.csproj">
@ -96,14 +132,17 @@
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="..\packages\ManagedWinapi.0.3\ManagedWinapiNativeHelper.dll">
<Link>ManagedWinapiNativeHelper.dll</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Resource Include="..\Resources\Oxygen-Icons.org-Oxygen-Status-media-playlist-repeat.ico"> <Resource Include="..\Resources\Oxygen-Icons.org-Oxygen-Status-media-playlist-repeat.ico">
<Link>Oxygen-Icons.org-Oxygen-Status-media-playlist-repeat.ico</Link> <Link>Oxygen-Icons.org-Oxygen-Status-media-playlist-repeat.ico</Link>
</Resource> </Resource>
</ItemGroup> </ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.

View file

@ -12,7 +12,8 @@ namespace Ninjacrab.PersistentWindows.SystrayShell
[STAThread] [STAThread]
static void Main() static void Main()
{ {
new PersistentWindowProcessor().Start(); PersistentWindowProcessor pwp = new PersistentWindowProcessor();
pwp.Start();
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);

View file

@ -37,7 +37,28 @@
<PropertyGroup> <PropertyGroup>
<StartupObject /> <StartupObject />
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="CommonServiceLocator, Version=2.0.5.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0, processorArchitecture=MSIL">
<HintPath>..\packages\CommonServiceLocator.2.0.5\lib\net45\CommonServiceLocator.dll</HintPath>
</Reference>
<Reference Include="ManagedWinapi"> <Reference Include="ManagedWinapi">
<HintPath>..\packages\ManagedWinapi.0.3\ManagedWinapi.dll</HintPath> <HintPath>..\packages\ManagedWinapi.0.3\ManagedWinapi.dll</HintPath>
</Reference> </Reference>
@ -63,17 +84,17 @@
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Prism.Mvvm.1.1.1\lib\net45\Microsoft.Practices.Prism.SharedInterfaces.dll</HintPath> <HintPath>..\packages\Prism.Mvvm.1.1.1\lib\net45\Microsoft.Practices.Prism.SharedInterfaces.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.Practices.ServiceLocation, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <HintPath>..\packages\NLog.4.6.8\lib\net45\NLog.dll</HintPath>
<HintPath>..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll</HintPath>
</Reference>
<Reference Include="NLog, Version=3.2.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\NLog.3.2.0.0\lib\net45\NLog.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Transactions" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
@ -122,7 +143,9 @@
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput> <LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource> </EmbeddedResource>
<None Include="packages.config" /> <None Include="packages.config">
<SubType>Designer</SubType>
</None>
<None Include="Properties\Settings.settings"> <None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput> <LastGenOutput>Settings.Designer.cs</LastGenOutput>
@ -130,7 +153,9 @@
<AppDesigner Include="Properties\" /> <AppDesigner Include="Properties\" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="App.config" /> <None Include="App.config">
<SubType>Designer</SubType>
</None>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Resource Include="..\Resources\Oxygen-Icons.org-Oxygen-Status-media-playlist-repeat.ico"> <Resource Include="..\Resources\Oxygen-Icons.org-Oxygen-Status-media-playlist-repeat.ico">

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="CommonServiceLocator" version="1.3" targetFramework="net45" /> <package id="CommonServiceLocator" version="2.0.5" targetFramework="net45" />
<package id="NLog" version="3.2.0.0" targetFramework="net45" /> <package id="NLog" version="4.6.8" targetFramework="net45" />
<package id="Prism" version="5.0.0" targetFramework="net45" /> <package id="Prism" version="5.0.0" targetFramework="net45" />
<package id="Prism.Composition" version="5.0.0" targetFramework="net45" /> <package id="Prism.Composition" version="5.0.0" targetFramework="net45" />
<package id="Prism.Interactivity" version="5.0.0" targetFramework="net45" /> <package id="Prism.Interactivity" version="5.0.0" targetFramework="net45" />