You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
633 B
23 lines
633 B
namespace RadeonResetBugFixService
|
|
{
|
|
using System;
|
|
using System.Runtime.InteropServices;
|
|
|
|
static class ConsoleHelper
|
|
{
|
|
private static class NativeMethods
|
|
{
|
|
[DllImport("kernel32.dll")]
|
|
public static extern IntPtr GetConsoleWindow();
|
|
|
|
[DllImport("user32.dll")]
|
|
public static extern bool IsWindowVisible(IntPtr hWnd);
|
|
}
|
|
|
|
// Code taken from https://stackoverflow.com/a/53716169
|
|
public static bool HaveVisibleConsole()
|
|
{
|
|
return NativeMethods.IsWindowVisible(NativeMethods.GetConsoleWindow());
|
|
}
|
|
}
|
|
}
|
|
|