Solved

screen capture

Posted on 1998-10-23
2
188 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
Comment Utility
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
Comment Utility
Whow, you are fast, only 7 minutes after I posted it!!!!!

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

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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…
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now