using System.Runtime.InteropServices; public static class Taskbar { [DllImport("user32.dll")] private static extern int FindWindow(string className, string windowText); [DllImport("user32.dll")] private static extern int ShowWindow(int hwnd, int command); private const int SW_HIDE = 0; private const int SW_SHOW = 1; private static int _taskbarHandle; private static int _startButtonHandle; static Taskbar() { _taskbarHandle = FindWindow("Shell_TrayWnd", ""); _startButtonHandle = FindWindow("Button", "Start"); } public static void Show() { ShowWindow(_taskbarHandle, SW_SHOW); ShowWindow(_startButtonHandle, SW_SHOW); } public static void Hide() { ShowWindow(_taskbarHandle, SW_HIDE); ShowWindow(_startButtonHandle, SW_HIDE); } }
ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.