Add --minimized command-line argument (#2817)

* Add experimental support for --minimized on Windows

* Simplify the code
This commit is contained in:
Łukasz Domeradzki
2023-02-08 16:11:50 +01:00
committed by GitHub
parent 573080e6c0
commit d3490b4e92
3 changed files with 36 additions and 2 deletions

View File

@@ -32,6 +32,9 @@ internal static partial class NativeMethods {
[SupportedOSPlatform("Windows")]
internal const uint EnableQuickEditMode = 0x0040;
[SupportedOSPlatform("Windows")]
internal const byte ShowWindowMinimize = 6;
[SupportedOSPlatform("Windows")]
internal const sbyte StandardInputHandle = -10;
@@ -103,6 +106,17 @@ internal static partial class NativeMethods {
internal static partial EExecutionState SetThreadExecutionState(EExecutionState executionState);
#endif
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
[SupportedOSPlatform("Windows")]
[return: MarshalAs(UnmanagedType.Bool)]
#if NETFRAMEWORK
[DllImport("user32.dll")]
internal static extern bool ShowWindow(nint hWnd, int nCmdShow);
#else
[LibraryImport("user32.dll")]
internal static partial bool ShowWindow(nint hWnd, int nCmdShow);
#endif
[Flags]
[SupportedOSPlatform("Windows")]
internal enum EExecutionState : uint {