Solved

screen capture

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
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…

910 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

20 Experts available now in Live!

Get 1:1 Help Now