Solved

screen capture

Posted on 1998-10-23
2
201 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

776 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