public static bool ForwardWindow(IntPtr hwnd) { if (hwnd != IntPtr.Zero) { DLLInclude.ShowWindow(hwnd, 1); DLLInclude.SetWindowPos(hwnd, -1, 0, 0, 0, 0, 1 | 2); DLLInclude.RECT rectHwnd; DLLInclude.GetWindowRect(hwnd, out rectHwnd); DLLInclude.MoveWindow(hwnd, 0, 0, rectHwnd.Right - rectHwnd.Left, rectHwnd.Bottom - rectHwnd.Top, true); } return(true); }
public static Bitmap ALT(IntPtr hwnd) { DLLInclude.RECT rectHwnd; DLLInclude.GetWindowRect(hwnd, out rectHwnd); Bitmap myImage = new Bitmap(rectHwnd.Right - rectHwnd.Left, rectHwnd.Bottom - rectHwnd.Top); Graphics gr = Graphics.FromImage(myImage); gr.CopyFromScreen(new Point(rectHwnd.Left, rectHwnd.Top), new Point(0, 0), new Size(rectHwnd.Right - rectHwnd.Left, rectHwnd.Bottom - rectHwnd.Top)); Bitmap bitImage = myImage; return(bitImage); }