Show live screens of other applications in one application window

Is it possible to show (in maximum) live screens of other applications that work simultaneously in one application window.

I have the following conceptual idea (see screenshot below): the main application is displayed while several excel applications are running at the same time. Instead of clicking (or tabbing) between applications or resizing these windows to be displayed on the screen, I would just simply enlarge the main application to show the life screens of all these open Excel workbooks.

enter image description here

+5
source share
2 answers

I use periodic calls for this PrintWindow.

, . .

[DllImport("User32.dll")]
public static extern bool PrintWindow(IntPtr hWnd, IntPtr hdcBlt, int nFlags

[StructLayout(LayoutKind.Sequential)]
struct RECT
{
    public int Left;
    public int Top;
    public int Right;
    public int Bottom;
}

public static Bitmap GetWindow(IntPtr hWnd)
{
    RECT rect;
    GetWindowRect(hWnd, out rect);

    int width = rect.Right - rect.Left;
    int height = rect.Bottom - rect.Top;
    if (width > 0 && height > 0)
    {
        // Build device context (dc)
        Bitmap bmp = new Bitmap(width, height, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
        Graphics gfxBmp = Graphics.FromImage(bmp);
        IntPtr hdcBitmap = gfxBmp.GetHdc();

        // drawing options
        int nFlags = 0;

        // execute call
        PrintWindow(hWnd, hdcBitmap, nFlags);

        // some clean-up
        gfxBmp.ReleaseHdc(hdcBitmap);
        gfxBmp.Dispose();

        return bmp;
    }
    else
    {
        return null;
    }

} // end function getWindow
+3

All Articles