Skip to content

Commit

Permalink
Merge #4051 Use better console hiding API
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed Mar 6, 2024
2 parents 4b56375 + be058dd commit 56fe6e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ All notable changes to this project will be documented in this file.
- [Multiple] Show repo ETag and parsing errors in Failed Downloads (#4030 by: HebaruSan)
- [Multiple] Properly clear AD upgrades from changeset (#4037 by: HebaruSan)
- [Multiple] De-over-parallelize Versions tab (#4049 by: HebaruSan)
- [GUI] Use better console hiding API (#4051 by: HebaruSan)

### Internal

Expand Down
9 changes: 3 additions & 6 deletions GUI/Util.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,14 @@ public static void AsyncInvoke<T>(T obj, Action action) where T : Control

// hides the console window on windows
// useful when running the GUI
[DllImport("kernel32.dll")]
private static extern IntPtr GetConsoleWindow();

[DllImport("user32.dll")]
private static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
[DllImport("kernel32.dll", SetLastError=true)]
private static extern int FreeConsole();

public static void HideConsoleWindow()
{
if (Platform.IsWindows)
{
ShowWindow(GetConsoleWindow(), 0);
FreeConsole();
}
}

Expand Down

0 comments on commit 56fe6e7

Please sign in to comment.