2012-04-03 5 views
5

同時に実行されている別のアプリケーションのライブ画面を1つのアプリケーションウィンドウ(最大化)で表示できますか?1つのアプリケーションウィンドウで他のアプリケーションのライブ画面を表示

私は次の概念的なアイデアを持っています(下のスクリーンショットを参照)。複数のExcelアプリケーションが同時に実行されている間、メインアプリケーションが表示されています。アプリケーション間でクリック(またはタブ移動)する代わりに、これらのウィンドウのサイズを変更して画面に表示する代わりに、メインアプリケーションを最大化して、開いているすべてのExcelワークブックのライフ画面を表示するだけです。私はそのためにPrintWindowに定期的な呼び出しを使用し

enter image description here

+0

私はアイデアが好き。何とかして、W7のタスクバーにはこのような機能があります。 –

+0

私のアプリケーションでは、データなどで定量化できない他のアプリケーションの「動作」や「外見」に従って、次に何をすべきかを判断する必要があり、視覚的に判断する必要があります。アプリケーション(またはタブ)を常に反転させるのは苦痛になります。 – KMC

答えて

3

私はこのソリューションには満足していませんが、少しハッキリです。しかし、隠されたウィンドウもスキャンします。

コード

[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 
関連する問題