mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 03:36:44 +02:00
[settings-ui] Settings WinUI3 (#17797)
* Add Settings.WinUI3 project * New namespace * Activation and Services * Assets and Behaviors * Converters and Helpers * Controls * View and ViewModels * Styles and Themes * OOBE * Strings * Small App moves * [check] Project files - publish profiles and launchSettings.json * [using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name workaround * [WIP] Workarounds to make it work * Fix suppressed warnings - naming * Add code analysis * Fix KBMPage and App dispatcher Fix MessageBox - replace with MessageDialog * Fix ImageResizerPage & mark ColorPickerButton with TODO * Add icon to windows Cleanup MainWindow.xaml.cs and OobeWindow.xaml.cs MainWindows and OobeWindow management * App Icon No framework and runtime subdirs * Remove PowerToys.Settings and Settings.UI from solution Update output paths * Installer work & publish.cmd * Fix dispatcher crashes * Fix crashes * Add all dlls to installer Cleanup installer Add OpenOOBE and OpenScoobe logic Fix minor issues Fix update scenario - REINSTALLMODE * Rename back namespaces, project name and project dir * [wip] move to winappsdk 1.1 * Fix propagating isElevated & installer runtimes dlls * Remove obsolete dir/file * PowerToys.Interop to netstandard2.0 * Move everything to .Net6 * [Settings] Always launch settings process non-elevated (#17791) * Move back to WinAppSdk 1.0.1 * Add Settings.WinUI3 project * New namespace * Activation and Services * Assets and Behaviors * Converters and Helpers * Controls * View and ViewModels * Styles and Themes * OOBE * Strings * Small App moves * [check] Project files - publish profiles and launchSettings.json * [using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name workaround * [WIP] Workarounds to make it work * Fix suppressed warnings - naming * Add code analysis * Fix KBMPage and App dispatcher Fix MessageBox - replace with MessageDialog * Fix ImageResizerPage & mark ColorPickerButton with TODO * Add icon to windows Cleanup MainWindow.xaml.cs and OobeWindow.xaml.cs MainWindows and OobeWindow management * App Icon No framework and runtime subdirs * Remove PowerToys.Settings and Settings.UI from solution Update output paths * Installer work & publish.cmd * Fix dispatcher crashes * Fix crashes * Add all dlls to installer Cleanup installer Add OpenOOBE and OpenScoobe logic Fix minor issues Fix update scenario - REINSTALLMODE * Rename back namespaces, project name and project dir * [wip] move to winappsdk 1.1 * Fix propagating isElevated & installer runtimes dlls * Remove obsolete dir/file * PowerToys.Interop to netstandard2.0 * Move everything to .Net6 * [Settings] Always launch settings process non-elevated (#17791) * Move back to WinAppSdk 1.0.1 * Revert merge conflict ARM64 removal * Fix KBM Browse overlay image button * Bring back settings publish profile * Update release.yml * Change target frameworkd windows version * [Setup] Add Windows Application Runtime SDK (#17809) * Update requirements doc * Update compiling docs * Fix signing * Fix Settings exe and dll versions * Add exception for dlls that have version 1.0.0.0 * Fix powershell condition Co-authored-by: Andrey Nekrasov <yuyoyuppe@users.noreply.github.com>
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using Windows.UI.Xaml;
|
||||
|
||||
namespace Microsoft.PowerToys.Settings.UI.Helpers
|
||||
{
|
||||
@@ -14,6 +13,17 @@ namespace Microsoft.PowerToys.Settings.UI.Helpers
|
||||
private const int GWL_STYLE = -16;
|
||||
private const int WS_POPUP = 1 << 31; // 0x80000000
|
||||
internal const int SPI_GETDESKWALLPAPER = 0x0073;
|
||||
internal const int SW_SHOWNORMAL = 1;
|
||||
internal const int SW_SHOWMAXIMIZED = 3;
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
internal static extern IntPtr GetActiveWindow();
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
internal static extern bool SetWindowPlacement(IntPtr hWnd, ref WINDOWPLACEMENT lpwndpl);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
internal static extern bool GetWindowPlacement(IntPtr hWnd, out WINDOWPLACEMENT lpwndpl);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
internal static extern uint SendInput(uint nInputs, NativeKeyboardHelper.INPUT[] pInputs, int cbSize);
|
||||
@@ -43,6 +53,7 @@ namespace Microsoft.PowerToys.Settings.UI.Helpers
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
|
||||
internal static extern bool SystemParametersInfo(int uiAction, int uiParam, StringBuilder pvParam, int fWinIni);
|
||||
|
||||
public static void SetPopupStyle(IntPtr hwnd)
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml;
|
||||
|
||||
namespace Microsoft.PowerToys.Settings.UI.Helpers
|
||||
{
|
||||
|
||||
25
src/settings-ui/Settings.UI/Helpers/POINT.cs
Normal file
25
src/settings-ui/Settings.UI/Helpers/POINT.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
// Copyright (c) Microsoft Corporation
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Microsoft.PowerToys.Settings.UI.Helpers
|
||||
{
|
||||
[Serializable]
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1815:Override equals and operator equals on value types", Justification = "Interop")]
|
||||
public struct POINT
|
||||
{
|
||||
public int X { get; set; }
|
||||
|
||||
public int Y { get; set; }
|
||||
|
||||
public POINT(int x, int y)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
}
|
||||
}
|
||||
}
|
||||
31
src/settings-ui/Settings.UI/Helpers/RECT.cs
Normal file
31
src/settings-ui/Settings.UI/Helpers/RECT.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
// Copyright (c) Microsoft Corporation
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Microsoft.PowerToys.Settings.UI.Helpers
|
||||
{
|
||||
[Serializable]
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1815:Override equals and operator equals on value types", Justification = "Interop")]
|
||||
public struct RECT
|
||||
{
|
||||
public int Left { get; set; }
|
||||
|
||||
public int Top { get; set; }
|
||||
|
||||
public int Right { get; set; }
|
||||
|
||||
public int Bottom { get; set; }
|
||||
|
||||
public RECT(int left, int top, int right, int bottom)
|
||||
{
|
||||
Left = left;
|
||||
Top = top;
|
||||
Right = right;
|
||||
Bottom = bottom;
|
||||
}
|
||||
}
|
||||
}
|
||||
27
src/settings-ui/Settings.UI/Helpers/WINDOWPLACEMENT.cs
Normal file
27
src/settings-ui/Settings.UI/Helpers/WINDOWPLACEMENT.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
// Copyright (c) Microsoft Corporation
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Microsoft.PowerToys.Settings.UI.Helpers
|
||||
{
|
||||
[Serializable]
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1815:Override equals and operator equals on value types", Justification = "Interop")]
|
||||
public struct WINDOWPLACEMENT
|
||||
{
|
||||
public int Length { get; set; }
|
||||
|
||||
public int Flags { get; set; }
|
||||
|
||||
public int ShowCmd { get; set; }
|
||||
|
||||
public POINT MinPosition { get; set; }
|
||||
|
||||
public POINT MaxPosition { get; set; }
|
||||
|
||||
public RECT NormalPosition { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user