Results 1 to 3 of 3

Thread: Capture Desktop Window

  1. #1

    Thread Starter
    Fanatic Member faisalkm's Avatar
    Join Date
    Oct 2000
    Location
    Germany
    Posts
    752

    Capture Desktop Window

    Ok.. i know how to capture the desktop window with Bitblt. But the problem is that I don't want my form with it.

    When I capture the Desktop Window..the image of my form is also captured withit and I want to avoid that..How can I do it?
    Faisal Muhammed
    Homepage:I Started making it in 1994 ...Still Under Construction
    Using

    Visual Basic 6.0 Enterprise SP5
    Embedded Visual Basic 3.0
    SQL Server 2000
    Windows 2000 Proff
    Delphi 6.0


    Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Try something like this
    VB Code:
    1. Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, _
    2. ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
    3.  
    4. Private Const VK_SNAPSHOT = &H2C
    5.  
    6. 'Author: Dalin Nie (Edited by Matthew Gates)
    7. 'Origin: [url]http://www.vbcode.com[/url]
    8. 'Purpose: This function capture the screen or the active window of your computer. Programmatically and save it to a .bmp file.
    9. 'VB version: VB 6,VB 5,VB 4/32
    10. 'Save Screen As Bitmap
    11. Private Function SaveScreen(ByVal theFile As String) As Boolean
    12. On Error Resume Next
    13.  
    14. 'To get the Entire Screen
    15. Call keybd_event(vbKeySnapshot, 1, 0, 0)
    16.  
    17. 'To get the Active Window
    18. 'Call keybd_event(vbKeySnapshot, 0, 0, 0)
    19.  
    20. SavePicture Clipboard.GetData(vbCFBitmap), theFile
    21.  
    22. SaveScreen = True
    23. Exit Function
    24. End Function
    25. 'Usage
    26. Call SaveScreen("C:\Windows\Desktop\shot1.bmp")

  3. #3

    Thread Starter
    Fanatic Member faisalkm's Avatar
    Join Date
    Oct 2000
    Location
    Germany
    Posts
    752
    Thanks!!!!! But thats not what I want...u know..there was an example from Microsoft that showed internet explorer icons flying on the desktop. Thats was a screensaver. I don't have the sample with me...so if u have it take a look and tell me..
    Faisal Muhammed
    Homepage:I Started making it in 1994 ...Still Under Construction
    Using

    Visual Basic 6.0 Enterprise SP5
    Embedded Visual Basic 3.0
    SQL Server 2000
    Windows 2000 Proff
    Delphi 6.0


    Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width