home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form Form1
- BorderStyle = 1 'Fixed Single
- Caption = "Screen Capture Demo"
- ClientHeight = 3375
- ClientLeft = 1680
- ClientTop = 1890
- ClientWidth = 4695
- Height = 4065
- Left = 1620
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 3375
- ScaleWidth = 4695
- Top = 1260
- Width = 4815
- Begin VB.CommandButton Command1
- Caption = "Capture"
- Height = 495
- Left = 3360
- TabIndex = 0
- Top = 1440
- Width = 1215
- End
- Begin ik32Lib.Picbuf Picbuf1
- Height = 3255
- Left = 120
- TabIndex = 1
- Top = 0
- Width = 3135
- _Version = 65536
- _ExtentX = 5530
- _ExtentY = 5741
- _StockProps = 253
- End
- Begin VB.Menu file
- Caption = "&File"
- Begin VB.Menu exit
- Caption = "E&xit"
- End
- End
- Attribute VB_Name = "Form1"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- 'Description: This code captures the screen to the
- 'picbuf control.
- Private Sub Command1_Click()
- Dim hDC As Integer
- Dim hmemdc As Integer
- Dim hbitmap As Integer
- Dim holdbitmap As Integer
- Dim RetVar As Integer
- hDC = CreateDC("DISPLAY", "", "", "")
- hbitmap = CreateCompatibleBitmap(hDC, 200, 200)
- hmemdc = CreateCompatibleDC(hDC)
- holdbitmap = SelectObject(hmemdc, hbitmap)
- RetVar = BitBlt(hmemdc, 0, 0, 200, 200, hDC, 0, 0, SRCCOPY)
- RetVar = SelectObject(hmemdc, holdbitmap)
- Picbuf1.BitmapToDib hbitmap
- RetVar = DeleteObject(hbitmap)
- RetVar = DeleteDC(hDC)
- RetVar = DeleteDC(hmemdc)
- End Sub
- 'Description: This code ends the program
- Private Sub exit_Click()
- End
- End Sub
- 'Description: This code sets properties for the
- 'picbuf control.
- Private Sub Form_Load()
- InitPicbuf Picbuf1, True
- End Sub
-