Esempio n. 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);
        }
Esempio n. 2
0
        public static IntPtr GetControlOnWindow(IntPtr windowInt, string controlName, string controlTitle)
        {
            IntPtr ıntPtr = WinAPI.FindWindowEx(windowInt, IntPtr.Zero, controlName, controlTitle);

            if (ıntPtr == IntPtr.Zero)
            {
                throw new Exception("Control not found.");
            }
            return(ıntPtr);
        }
Esempio n. 3
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);
        }