|
-
November 27th, 1999, 01:00 PM
#1
How can I copy the screen in the printer objekt?
This is my code.
Function PrintScreen()
Dim r As Long
Dim hWndDesk As Long
Dim hDCDesk As Long
Dim LeftDesk As Long
Dim TopDesk As Long
Dim WidthDesk As Long
Dim HeightDesk As Long
'define the screen coordinates (upper
'corner (0,0) and lower corner (Width, Height)
LeftDesk = 0
TopDesk = 0
WidthDesk = Screen.Width \ Screen.TwipsPerPixelX
HeightDesk = Screen.Height \ Screen.TwipsPerPixelY
'get the desktop handle and display context
hWndDesk = GetDesktopWindow()
hDCDesk = GetWindowDC(hWndDesk)
'copy the desktop to the picture box
r = BitBlt(frm40_druck!Picture1.hdc, 0, 0, _
WidthDesk, HeightDesk, hDCDesk, _
LeftDesk, TopDesk, vbSrcCopy)
r = ReleaseDC(hWndDesk, hDCDesk)
'Now I want to copy this to in the printer objekt 'but it doesn't work? How could it work?
'Printer.PaintPicture _
frm40_druck!Picture1.Picture, 0, 0, _
WidthDesk, HeightDesk, hDCDesk, _
LeftDesk, TopDesk, vbSrcCopy
'Printer.EndDoc
End Function
Student
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|