[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.drawing

Screen Capture excluding overlapping windows

Todd Tingen

12/1/2004 6:37:00 PM

I need to capture the screen of another application's window but when part
of the window is overlapped by other applications/windows the capture
retrieves the overlapping window's graphic as well. Is there a way to
retrieve just the underlying window? The taskswitcher power toy in XP is
able to do this I would like to know how it works. Thanks for any help.
Here's an example of my problem:

the desktop might look like this and I want to capture just object A:

+----------------------+
| |
| |
| |
+------------| Object B |
| | |
| +----------------------+
| Object A |
| |
+-------------------------+

the capture returns:

+------------| Object B
| |
| +-------------
| Object A |
| |
+-------------------------+

when I want just:

+-------------------------+
| |
| |
| Object A |
| |
+-------------------------+



2 Answers

Bob Powell

12/2/2004 5:13:00 PM

0

You should be able to use interop and the PrintWindow API.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tips...

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/f...

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.





"Todd Tingen" <tingent@comcast.net> wrote in message
news:eTtqOT91EHA.3616@TK2MSFTNGP11.phx.gbl...
> I need to capture the screen of another application's window but when part
> of the window is overlapped by other applications/windows the capture
> retrieves the overlapping window's graphic as well. Is there a way to
> retrieve just the underlying window? The taskswitcher power toy in XP is
> able to do this I would like to know how it works. Thanks for any help.
> Here's an example of my problem:
>
> the desktop might look like this and I want to capture just object A:
>
> +----------------------+
> | |
> | |
> | |
> +------------| Object B |
> | | |
> | +----------------------+
> | Object A |
> | |
> +-------------------------+
>
> the capture returns:
>
> +------------| Object B
> | |
> | +-------------
> | Object A |
> | |
> +-------------------------+
>
> when I want just:
>
> +-------------------------+
> | |
> | |
> | Object A |
> | |
> +-------------------------+
>
>
>


Todd Tingen

12/3/2004 6:22:00 PM

0

Thanks. That worked like a charm.




"Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> wrote in message
news:%234ixFJJ2EHA.2676@TK2MSFTNGP12.phx.gbl...
> You should be able to use interop and the PrintWindow API.
>
> --
> Bob Powell [MVP]
> Visual C#, System.Drawing
>
> Find great Windows Forms articles in Windows Forms Tips and Tricks
> http://www.bobpowell.net/tips...
>
> Answer those GDI+ questions with the GDI+ FAQ
> http://www.bobpowell.net/f...
>
> All new articles provide code in C# and VB.NET.
> Subscribe to the RSS feeds provided and never miss a new article.
>
>
>
>
>
> "Todd Tingen" <tingent@comcast.net> wrote in message
> news:eTtqOT91EHA.3616@TK2MSFTNGP11.phx.gbl...
> > I need to capture the screen of another application's window but when
part
> > of the window is overlapped by other applications/windows the capture
> > retrieves the overlapping window's graphic as well. Is there a way to
> > retrieve just the underlying window? The taskswitcher power toy in XP
is
> > able to do this I would like to know how it works. Thanks for any help.
> > Here's an example of my problem:
> >
> > the desktop might look like this and I want to capture just object A:
> >
> > +----------------------+
> > | |
> > | |
> > | |
> > +------------| Object B |
> > | | |
> > | +----------------------+
> > | Object A |
> > | |
> > +-------------------------+
> >
> > the capture returns:
> >
> > +------------| Object B
> > | |
> > | +-------------
> > | Object A |
> > | |
> > +-------------------------+
> >
> > when I want just:
> >
> > +-------------------------+
> > | |
> > | |
> > | Object A |
> > | |
> > +-------------------------+
> >
> >
> >
>
>