Solved

screen capture

Posted on 1998-10-23
2
209 Views
Last Modified: 2010-04-30
I need to capture the ENTIRE screen (my program must not be visible) and then I want that picture shown on the desktop, completely covering it so that it looks like you're watching the desktop, but in fact your watching a picture.
0
Comment
Question by:fax
2 Comments
 
LVL 1

Accepted Solution

by:
sdbanks earned 50 total points
ID: 1441312
I found this cod on vb-worlds online tips section:

Add the following code to a module:

            Declare Function BitBlt Lib "gdi32" _
            (ByVal hDestDC As Integer, ByVal x As Integer, _
            ByVal y As Integer, ByVal nWidth As Integer, _
            ByVal nHeight As Integer, ByVal _
            hSrcDC As Integer, ByVal xSrc As Integer, _
            ByVal ySrc As Integer, ByVal dwRop As _
            Long) As Integer

                Declare Function GetDesktopWindow Lib "user32" () As Long

                Declare Function GetDC Lib "user32" _
                (ByVal hwnd As Long) As Long

                Public Const SRCCOPY = &HCC0020
                Public Const SRCAND = &H8800C6
                Public Const SRCINVERT = &H660046

                Form Code

                Set the Form properties to the following:

                 AutoRedraw    True
                 BorderStyle   0 - None

                 WindowState   2 -
                               Maximized

                Now, add the following code to the form:

                Private Sub Form_Load()

                Dim DeskhWnd As Long, DeskDC As Long

                'Get the hWnd of the desktop
                DeskhWnd& = GetDesktopWindow()

                'BitBlt needs the DC to copy the image. So, we
                'need the GetDC API.
                DeskDC& = GetDC(DeskhWnd&)

                BitBlt Form1.hDC, 0&, 0&, _
                Screen.Width, Screen.Height, DeskDC&, _
                0&, 0&, SRCCOPY

                End Sub

                Add a command button to the form with following code:

                Private Sub Command1_Click()
                Unload Me
                End
                End Sub

0
 

Author Comment

by:fax
ID: 1441313
Whow, you are fast, only 7 minutes after I posted it!!!!!

I'll go check yer answer out now, cu later
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question