Capture Window or Form (Print Screen) using vb6

Description:Have you ever wanted to capture your screen and save the picture somewhere on your harddisk..! This vb6 source code helps you to capture the whole computer screen and display it in a picture box. You can also capture any form in your program. First create a vb6 project insert a picturebox (say picture1). Now copy paste this code to a new module (say module1)

Code:

Usage:
To capture the whole screen:

To capture a form (say form1)

Now you can easily save this picture. You can use this code for using parental controls such as you can get a picture what your child was using. The capture screen function does the same function what the PrintScreen button on your keyboard does. If any comments, please post here

6 comments

  1. Just type the following code, John;

    SavePicture Picture1.Picture, “D:pic.jpg”

    (Picture1 is the name of your picture box and also you can change the filename)

  2. my name is Joaquim and i have 1 question:
    – i’m building a control and i need capture it’s container(or parent). but my problem is that bitblt() api function is only give me the container image(and not capture the container):(
    can anyone advice me?

  3. It turns out the problem is caused by a “feature” of Webroot. In an attempt to protect you against potential problems from software with which Webroot is not familiar, Webroot interferes with Copy & Paste. Thanks to the folks at Just Great Software [http://www.just-great-software.com] for pointing this out. Here’s their solution:

    After some more digging we found that the inability to paste is actually a “feature” of WebRoot. Presumably WebRoot thinks that text copied from applications like browsers and email clients may be sensitive, and shouldn’t be pasted by other applications without your permission. If you are running WebRoot SecureAnywhere, follow these steps to make sure that you can paste without restriction into your favorite applications:
    * Open WebRoot SecureAnywhere
    * Click the Identity & Privacy tab
    * Click on Identity Shield in the left hand list
    * Click the View/Edit Protected Applications link
    * Select the Allow option for all applications that you want to be able to copy and paste text normally

Leave a Reply

Your email address will not be published. Required fields are marked *