Attribute VB_Name = " ModuleCapturePic " Option Explicit Option Base 0 'Powered by barenx Private Type PALETTEENTRY peRed As Byte peGreen As Byte peBlue As Byte peFlags As Byte End Type Private Type LOGPALETTE palVersion As Integer palNumEntries As Integer palPalEntry( 255 ) As PALETTEENTRY ' Enough for 256 colors. End Type Private Type GUID Data1 As Long Data2 As Integer Data3 As Integer Data4( 7 ) As Byte End Type Private Const RASTERCAPS As Long = 38 Private Const RC_PALETTE As Long = & H100 Private Const SIZEPALETTE As Long = 104 Private Type RECT Left As Long Top As Long right As Long bottom As Long End Type Private Declare Function CreateCompatibleDC() Function CreateCompatibleDC Lib "gdi32" (ByVal hdc As Long) As LongPrivate Declare Function CreateCompatibleBitmap()Function CreateCompatibleBitmap Lib "gdi32" (ByVal hdc As Long, ByVal nWidth As Long, ByVal nHeight As Long) As LongPrivate Declare Function GetDeviceCaps()Function GetDeviceCaps Lib "gdi32" (ByVal hdc As Long, ByVal iCapabilitiy As Long) As LongPrivate Declare Function GetSystemPaletteEntries()Function GetSystemPaletteEntries Lib "gdi32" (ByVal hdc As Long, ByVal wStartIndex As Long, ByVal wNumEntries As Long, lpPaletteEntries As PALETTEENTRY) As LongPrivate Declare Function CreatePalette()Function CreatePalette Lib "gdi32" (lpLogPalette As LOGPALETTE) As LongPrivate Declare Function SelectObject()Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As LongPrivate Declare Function BitBlt()Function BitBlt Lib "gdi32" (ByVal hDCDest As Long, ByVal XDest As Long, ByVal YDest As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hDCSrc As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As LongPrivate Declare Function DeleteDC()Function DeleteDC Lib "gdi32" (ByVal hdc As Long) As LongPrivate Declare Function GetForegroundWindow()Function GetForegroundWindow Lib "user32" () As LongPrivate Declare Function SelectPalette()Function SelectPalette Lib "gdi32" (ByVal hdc As Long, ByVal hPalette As Long, ByVal bForceBackground As Long) As LongPrivate Declare Function RealizePalette()Function RealizePalette Lib "gdi32" (ByVal hdc As Long) As LongPrivate Declare Function GetWindowDC()Function GetWindowDC Lib "user32" (ByVal hwnd As Long) As LongPrivate Declare Function GetDC()Function GetDC Lib "user32" (ByVal hwnd As Long) As LongPrivate Declare Function GetWindowRect()Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long