public void HideWindow(NativeWindowModel window) { if (!window.IsHasProcessExits()) { User32Window.ShowWindow(window.Handle, (short)User32Window.Cmd_SHOWWINDOWS.SW_HIDE); } }
public void HideWindow_Click() { if (!IsHasProcessExits()) { User32Window.ShowWindow(SelectWindow.Handle, (short)User32Window.Cmd_SHOWWINDOWS.SW_HIDE); } }
public void MaximizeWindow_Click() { if (!IsHasProcessExits()) { //最大化启动的程序 User32Window.ShowWindow(SelectWindow.Handle, (short)User32Window.Cmd_SHOWWINDOWS.SW_MAXIMIZE); } }
public void MaximizeWindow(NativeWindowModel window) { if (!window.IsHasProcessExits()) { //最大化启动的程序 User32Window.ShowWindow(window.Handle, (short)User32Window.Cmd_SHOWWINDOWS.SW_MAXIMIZE); } }
public void NormalWindow_Click() { if (!IsHasProcessExits()) { User32Window.ShowWindow(SelectWindow.Handle, (short)User32Window.Cmd_SHOWWINDOWS.SW_RESTORE); int p1 = User32.GetWindowLong(SelectWindow.Handle, (int)WindowLongFlags.GWL_STYLE); User32.SetWindowLong(SelectWindow.Handle, (int)WindowLongFlags.GWL_STYLE, (int)p1); } }
public void NormalWindow(NativeWindowModel window) { if (!window.IsHasProcessExits()) { User32Window.ShowWindow(window.Handle, (short)User32Window.Cmd_SHOWWINDOWS.SW_RESTORE); int p1 = User32Window.GetWindowLongA(window.Handle, (int)WindowLongFlags.GWL_STYLE); User32Window.SetWindowLong(window.Handle, (int)WindowLongFlags.GWL_STYLE, p1); } }
public void ToWallerpaperWindow(NativeWindowModel window) { if (!window.IsHasProcessExits()) { //最大化启动的程序 User32Window.ShowWindow(window.Handle, (short)User32Window.Cmd_SHOWWINDOWS.SW_RESTORE); IntPtr progman = User32Window.FindWindow("Progman", null); IntPtr result = User32Window.SendMessage(progman, 0x052C, new IntPtr(0), IntPtr.Zero); IntPtr workerw = IntPtr.Zero; User32Window.EnumWindows(((tophandle, topparamhandle) => { IntPtr p = User32Window.FindWindowEx(tophandle, IntPtr.Zero, "SHELLDLL_DefView", null); if (p != IntPtr.Zero) { workerw = User32Window.FindWindowEx(IntPtr.Zero, tophandle, "WorkerW", null); } return(true); }), IntPtr.Zero); SetParentWindow(window.Handle, workerw); int p1 = User32Window.GetWindowLongA(window.Handle, (int)WindowLongFlags.GWL_STYLE); p1 &= ~13500416; User32Window.SetWindowLong(window.Handle, (int)WindowLongFlags.GWL_STYLE, p1); //最大化启动的程序 User32Window.ShowWindow(window.Handle, (short)User32Window.Cmd_SHOWWINDOWS.SW_MAXIMIZE); //User32Window.MoveWindow(window.Handle, 0, 0, Screen.AllScreens[0].WorkingArea.Width, // Screen.AllScreens[0].WorkingArea.Height, false); User32Window.SetActiveWindow(window.Handle); } }