PC Review


Reply
Thread Tools Rate Thread

How to capture active window as screenshot?

 
 
Dean Slindee
Guest
Posts: n/a
 
      17th Jul 2004
I would like to capture a picture of the active window on the screen to use
in an error routine.
Like the following, which captures the entire desktop:
Dim objRectangle As Rectangle = Screen.PrimaryScreen.Bounds

Dim objBitmap As New Bitmap(objRectangle.Right, objRectangle.Bottom)

How can I isolate down to just the active window?

Thanks,

Dean Slindee


 
Reply With Quote
 
 
 
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      17th Jul 2004
* "Dean Slindee" <(E-Mail Removed)> scripsit:
> I would like to capture a picture of the active window on the screen to use
> in an error routine.


<URL:http://dotnet.mvps.org/dotnet/samples/windowsandforms/downloads/Screenshot.zip>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
 
Reply With Quote
 
Dean Slindee
Guest
Posts: n/a
 
      19th Jul 2004
Care to double check my testing of this project? It appears that the code
to capture the active window is there, but that there is no way provided to
branch into that code. It always takes a desktop screenshot.

What code would it snap an active window screenshot?

Thanks,
Dean Slindee
"Herfried K. Wagner [MVP]" <hirf-spam-me-(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> * "Dean Slindee" <(E-Mail Removed)> scripsit:
> > I would like to capture a picture of the active window on the screen to

use
> > in an error routine.

>
>

<URL:http://dotnet.mvps.org/dotnet/sample...nloads/Screens
hot.zip>
>
> --
> Herfried K. Wagner [MVP]
> <URL:http://dotnet.mvps.org/>



 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      19th Jul 2004
* "Dean Slindee" <(E-Mail Removed)> scripsit:
> Care to double check my testing of this project? It appears that the code
> to capture the active window is there, but that there is no way provided to
> branch into that code. It always takes a desktop screenshot.
>
> What code would it snap an active window screenshot?


\\\
Private Declare Function GetForegroundWindow Lib "user32.dll" () As IntPtr
..
..
..
foo.Window = GetForegroundWindow()
Dim b As Bitmap = foo.Capture()
///

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
<URL:http://dotnet.mvps.org/dotnet/faqs/>
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can Excel capture a screenshot? Albert Microsoft Excel Programming 2 8th Sep 2008 10:30 PM
Capture screenshot of video automatically? VB Programmer Microsoft ASP .NET 2 30th Nov 2006 08:27 AM
Capture-A-ScreenShot Tramp Freeware 0 16th May 2006 04:21 PM
screenshot capture program winsnap tf76 Freeware 3 12th Mar 2006 04:16 PM
Screenshot of active window Simon Broad Windows XP General 2 1st Nov 2003 04:07 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:53 PM.