VB screen capture code-what is the problem here!

Sharky Forums


Results 1 to 4 of 4

Thread: VB screen capture code-what is the problem here!

  1. #1
    Catfish
    Join Date
    Jun 2001
    Posts
    171

    Post VB screen capture code-what is the problem here!

    I have this code to capture a screen shot in MS Access:

    Option Compare Database
    Option Explicit

    Type RECT_Type

    left As Long
    top As Long
    right As Long
    bottom As Long

    End Type

    'The following declare statements are case sensitive.

    Declare Function GetActiveWindow Lib "User32" () As Long
    Declare Function GetDesktopWindow Lib "User32" () As Long
    Declare Sub GetWindowRect Lib "User32" (ByVal Hwnd As Long, _
    lpRect As RECT_Type)
    Declare Function GetDC Lib "User32" (ByVal Hwnd As Long) As Long
    Declare Function CreateCompatibleDC Lib "Gdi32" (ByVal hdc As Long) _
    As Long
    Declare Function CreateCompatibleBitmap Lib "Gdi32" (ByVal hdc _
    As Long, ByVal nWidth As Long, _
    ByVal nHeight As Long) As Long
    Declare Function SelectObject Lib "Gdi32" (ByVal hdc As Long, _
    ByVal hObject As Long) As Long
    Declare Function BitBlt Lib "Gdi32" (ByVal hDestDC As Long, _
    ByVal X As Long, ByVal Y _
    As Long, ByVal nWidth As Long, _
    ByVal nHeight As Long, _
    ByVal hSrcDC As Long, _
    ByVal XSrc As Long, _
    ByVal YSrc As Long, _
    ByVal dwRop As Long) As Long
    Declare Function OpenClipboard Lib "User32" (ByVal Hwnd As Long) As Long
    Declare Function EmptyClipboard Lib "User32" () As Long
    Declare Function SetClipboardData Lib "User32" (ByVal wFormat As Long, _
    ByVal hMem As Long) As Long
    Declare Function CloseClipboard Lib "User32" () As Long
    Declare Function ReleaseDC Lib "User32" (ByVal Hwnd As Long, _
    ByVal hdc As Long) As Long
    Declare Function DeleteDC Lib "Gdi32" (ByVal hdc As Long) As Long

    Global Const SRCCOPY = &HCC0020
    Global Const CF_BITMAP = 2

    The last two statements are red and I have no clue what is wrong?!

  2. #2
    Hammerhead Shark hobbes2112's Avatar
    Join Date
    Jul 2001
    Posts
    1,553

    Post

    nm....
    ------------------
    Why Yes! I am a proud member of the SF Linux Hippy Club.

    [This message has been edited by hobbes2112 (edited December 04, 2001).]

  3. #3
    Tiger Shark Thraner's Avatar
    Join Date
    Sep 2001
    Location
    Parma, OH USA
    Posts
    809

    Post

    Originally posted by bruss4:
    Global Const SRCCOPY = &HCC0020
    Global Const CF_BITMAP = 2

    The last two statements are red and I have no clue what is wrong?!
    don't those have to be declared in a standard code module?? (bas file)
    what about the keyword Public instead of Global?
    Thraner

    Thraner

  4. #4
    Hammerhead Shark hobbes2112's Avatar
    Join Date
    Jul 2001
    Posts
    1,553

    Post

    That is what I said, but I thought it was wrong so I edited my post I would say those work the best in a code module as Publics.....

    ------------------
    Why Yes! I am a proud member of the SF Linux Hippy Club.

Posting Permissions

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