mirror of
https://github.com/terrymacdonald/DisplayMagician.git
synced 2024-08-30 18:32:20 +00:00
[WIP] TaskBar changes
This commit is contained in:
parent
c9a349125d
commit
a13aa60258
@ -26,8 +26,8 @@ using System.Resources;
|
||||
[assembly: Guid("e4ceaf5e-ad01-4695-b179-31168eb74c48")]
|
||||
|
||||
// Version information
|
||||
[assembly: AssemblyVersion("2.2.0.157")]
|
||||
[assembly: AssemblyFileVersion("2.2.0.157")]
|
||||
[assembly: AssemblyVersion("2.2.0.159")]
|
||||
[assembly: AssemblyFileVersion("2.2.0.159")]
|
||||
[assembly: NeutralResourcesLanguageAttribute( "en" )]
|
||||
[assembly: CLSCompliant(true)]
|
||||
|
||||
|
@ -146,7 +146,7 @@ namespace DisplayMagician.UIForms
|
||||
|
||||
WINDOWS_DISPLAY_CONFIG winConfig = Profile.WindowsDisplayConfig;
|
||||
// Reset the taskbar layout binary to the original one we stored when the profile was made
|
||||
winConfig.TaskBarLayout = new List<TaskBarStuckRectangle>(winConfig.OriginalTaskBarLayout);
|
||||
//winConfig.TaskBarLayout = new List<TaskBarStuckRectangle>(winConfig.OriginalTaskBarLayout);
|
||||
if (rb_default_taskbar.Checked)
|
||||
{
|
||||
winConfig.TaskBarForcedEdge = TaskBarForcedEdge.None;
|
||||
|
@ -100,16 +100,18 @@ namespace DisplayMagicianShared.Windows
|
||||
MainScreen = false;
|
||||
DevicePath = devicePath;
|
||||
Binary = binary;
|
||||
OriginalBinary = new byte[binary.Length];
|
||||
binary.CopyTo(OriginalBinary, 0);
|
||||
Version = version;
|
||||
|
||||
// Extract the values from the binary byte field
|
||||
PopulateFieldsFromBinary();
|
||||
|
||||
SharedLogger.logger.Trace($"WinLibrary/GetWindowsDisplayConfig: The taskbar for {DevicePath} is against the {Edge} edge, is positioned at ({Location.X},{Location.Y}) and is {Location.Width}x{Location.Height} in size.");
|
||||
SharedLogger.logger.Trace($"TaskBarStuckRectangle/TaskBarStuckRectangle: The taskbar for {DevicePath} is against the {Edge} edge, is positioned at ({Location.X},{Location.Y}) and is {Location.Width}x{Location.Height} in size.");
|
||||
}
|
||||
else
|
||||
{
|
||||
SharedLogger.logger.Trace($"WinLibrary/GetWindowsDisplayConfig: Unable to get the TaskBarStuckRectangle binary settings from {devicePath} screen.");
|
||||
SharedLogger.logger.Trace($"TaskBarStuckRectangle/TaskBarStuckRectangle: Unable to get the TaskBarStuckRectangle binary settings from {devicePath} screen.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -156,16 +158,18 @@ namespace DisplayMagicianShared.Windows
|
||||
MainScreen = true;
|
||||
DevicePath = devicePath;
|
||||
Binary = binary;
|
||||
OriginalBinary = new byte[binary.Length];
|
||||
binary.CopyTo(OriginalBinary, 0);
|
||||
Version = version;
|
||||
|
||||
// Extract the values from the binary byte field
|
||||
PopulateFieldsFromBinary();
|
||||
|
||||
SharedLogger.logger.Trace($"WinLibrary/GetWindowsDisplayConfig: The taskbar for {DevicePath} is against the {Edge} edge, is positioned at ({Location.X},{Location.Y}) and is {Location.Width}x{Location.Height} in size.");
|
||||
SharedLogger.logger.Trace($"TaskBarStuckRectangle/TaskBarStuckRectangle: The taskbar for {DevicePath} is against the {Edge} edge, is positioned at ({Location.X},{Location.Y}) and is {Location.Width}x{Location.Height} in size.");
|
||||
}
|
||||
else
|
||||
{
|
||||
SharedLogger.logger.Trace($"WinLibrary/GetWindowsDisplayConfig: Unable to get the TaskBarStuckRectangle binary settings from {devicePath} screen.");
|
||||
SharedLogger.logger.Trace($"TaskBarStuckRectangle/TaskBarStuckRectangle: Unable to get the TaskBarStuckRectangle binary settings from {devicePath} screen.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -603,12 +607,12 @@ namespace DisplayMagicianShared.Windows
|
||||
RegistryKeyPermissionCheck.ReadWriteSubTree))
|
||||
{
|
||||
key.SetValue(DevicePath, Binary);
|
||||
SharedLogger.logger.Trace($"TaskBarStuckRectangle/Apply: Successfully applied TaskBarStuckRectangle registry settings for the {DevicePath} Screen in {address}!");
|
||||
SharedLogger.logger.Trace($"TaskBarStuckRectangle/WriteToRegistry: Successfully applied TaskBarStuckRectangle registry settings for the {DevicePath} Screen in {address}!");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SharedLogger.logger.Error(ex, $"TaskBarStuckRectangle/GetCurrent: Unable to set the {DevicePath} TaskBarStuckRectangle registry settings in {address} due to an exception!");
|
||||
SharedLogger.logger.Error(ex, $"TaskBarStuckRectangle/WriteToRegistry: Unable to set the {DevicePath} TaskBarStuckRectangle registry settings in {address} due to an exception!");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,7 @@ namespace DisplayMagicianShared.Windows
|
||||
public List<ADVANCED_HDR_INFO_PER_PATH> DisplayHDRStates;
|
||||
public Dictionary<string, GDI_DISPLAY_SETTING> GdiDisplaySettings;
|
||||
public List<TaskBarStuckRectangle> TaskBarLayout;
|
||||
public List<TaskBarStuckRectangle> OriginalTaskBarLayout;
|
||||
//public List<TaskBarStuckRectangle> OriginalTaskBarLayout;
|
||||
public TaskBarForcedEdge TaskBarForcedEdge;
|
||||
|
||||
public TaskBarSettings TaskBarSettings;
|
||||
@ -187,7 +187,7 @@ namespace DisplayMagicianShared.Windows
|
||||
myDefaultConfig.DisplaySources = new Dictionary<string, List<uint>>();
|
||||
myDefaultConfig.GdiDisplaySettings = new Dictionary<string, GDI_DISPLAY_SETTING>();
|
||||
myDefaultConfig.TaskBarLayout = new List<TaskBarStuckRectangle>();
|
||||
myDefaultConfig.OriginalTaskBarLayout = new List<TaskBarStuckRectangle>();
|
||||
//myDefaultConfig.OriginalTaskBarLayout = new List<TaskBarStuckRectangle>();
|
||||
myDefaultConfig.TaskBarSettings = new TaskBarSettings();
|
||||
myDefaultConfig.TaskBarForcedEdge = TaskBarForcedEdge.None;
|
||||
myDefaultConfig.IsCloned = false;
|
||||
@ -653,7 +653,7 @@ namespace DisplayMagicianShared.Windows
|
||||
windowsDisplayConfig.DisplayConfigModes = modes;
|
||||
windowsDisplayConfig.GdiDisplaySettings = GetGdiDisplaySettings();
|
||||
windowsDisplayConfig.TaskBarLayout = taskBarStuckRectangles;
|
||||
windowsDisplayConfig.OriginalTaskBarLayout = new List<TaskBarStuckRectangle>(taskBarStuckRectangles);
|
||||
//windowsDisplayConfig.OriginalTaskBarLayout = new List<TaskBarStuckRectangle>(taskBarStuckRectangles);
|
||||
windowsDisplayConfig.TaskBarSettings = taskBarSettings;
|
||||
|
||||
return windowsDisplayConfig;
|
||||
@ -1401,7 +1401,7 @@ namespace DisplayMagicianShared.Windows
|
||||
}
|
||||
else
|
||||
{
|
||||
SharedLogger.logger.Error($"WinLibrary/GetCurrent: Unable to set the {tbsr.DevicePath} TaskBarStuckRectangle registry settings as the version isn't v2 or v3!");
|
||||
SharedLogger.logger.Error($"WinLibrary/SetActiveConfig: Unable to set the {tbsr.DevicePath} TaskBarStuckRectangle registry settings as the version isn't v2 or v3!");
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user