using System.Runtime.InteropServices;

const int swShow = 5;
ShowClass("Shell_TrayWnd");
ShowClass("Shell_SecondaryTrayWnd");
Console.WriteLine("Taskbar gendannet.");

static void ShowClass(string className)
{
    var handle = FindWindow(className, null);
    while (handle != nint.Zero)
    {
        ShowWindow(handle, swShow);
        handle = FindWindowEx(nint.Zero, handle, className, null);
    }
}

[DllImport("user32.dll", CharSet = CharSet.Unicode)]
static extern nint FindWindow(string? className, string? windowName);

[DllImport("user32.dll", CharSet = CharSet.Unicode)]
static extern nint FindWindowEx(nint parent, nint childAfter, string? className, string? windowName);

[DllImport("user32.dll")]
static extern bool ShowWindow(nint hWnd, int nCmdShow);
