?
Solved

screen capture

Posted on 1998-10-23
2
Medium Priority
?
221 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Accepted Solution

by:
sdbanks earned 100 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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 …
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…
Suggested Courses
Course of the Month14 days, 1 hour left to enroll

800 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