Пример #1
0
        public static void ShowTaskBar()
        {
            IntPtr desktopWindow = WinAPI.GetDesktopWindow();
            IntPtr hWnd          = WinAPI.FindWindowEx(desktopWindow, 0, "button", 0);
            IntPtr hWnd2         = WinAPI.FindWindowEx(desktopWindow, 0, "Shell_TrayWnd", 0);

            WinAPI.SetWindowPos(hWnd, 0, 0, 0, 0, 0, 64);
            WinAPI.SetWindowPos(hWnd2, 0, 0, 0, 0, 0, 64);
        }
Пример #2
0
        public static void HideTaskBar()
        {
            //IntPtr desktopWindow = WinAPI.GetDesktopWindow();
            //IntPtr hWnd = WinAPI.FindWindowEx(desktopWindow, 0, "button", 0);
            //IntPtr hWnd2 = WinAPI.FindWindowEx(desktopWindow, 0, "Shell_TrayWnd", 0);
            //WinAPI.SetWindowPos(hWnd, 0, 0, 0, 0, 0, 128);
            //WinAPI.SetWindowPos(hWnd2, 0, 0, 0, 0, 0, 128);

            IntPtr    desktopWindow = WinAPI.GetDesktopWindow();
            IntPtr    hWnd          = WinAPI.FindWindowEx(desktopWindow, 0, "button", 0);
            Rectangle rec           = new Rectangle();
            var       windowRec     = WinAPI.GetWindowRect(hWnd, out rec);

            WinAPI.SetWindowPos(hWnd, 0, Screen.AllScreens[1].WorkingArea.Left, Screen.AllScreens[1].WorkingArea.Top, rec.Size.Width, rec.Size.Height, 0x0001 | 0x0040);
        }
Пример #3
0
 public static void Show(IntPtr hWnd)
 {
     WinAPI.SetWindowPos(hWnd, 0, 0, 0, 0, 0, 64);
 }
Пример #4
0
 public static void Hide(IntPtr hWnd)
 {
     WinAPI.SetWindowPos(hWnd, 0, 0, 0, 0, 0, 128);
 }
Пример #5
0
 public static void Resize(IntPtr hWnd, int width, int height)
 {
     WinAPI.SetWindowPos(hWnd, 0, 0, 0, width, height, 2);
 }
Пример #6
0
 public static void Move(IntPtr hWnd, int x, int y)
 {
     WinAPI.SetWindowPos(hWnd, 0, x, y, 0, 0, 1);
 }