>Can anyone give me some ideas about tricky ways to print a hardcopy of a form (VFP5/Win95)? I have a form and I'd like to programmatically print an image of the form. Or, do a print screen by clicking a VFP control. Or, is there a fast way to transfer the layout of the field text boxes into a report format? There are many times I would like to give the users the equivalent of a print screen button without having to go to the work of creating a report page that looks like the form.
>
>Thanks,
>Allen
1) Define a report called PRINTSCR.FRX with a general field in it
2) Have your button execute the following code:
LOCAL cArea
cArea = SELECT()
DECLARE INTEGER keybd_event IN Win32API ;
INTEGER, INTEGER, INTEGER, INTEGER
keybd_event(44,0,0,0)
CREATE CURSOR screen_capture (screen G)
APPEND BLANK
DEFINE WINDOW screen_capture FROM 100,100 TO 263,263
MODIFY GENERAL screen_capture.screen NOWAIT WINDOW screen_capture
KEYBOARD "{Ctrl+V}{Ctrl+W}" CLEAR
RELEASE WIND screen_capture
DOEVENTS
REPORT FORM ('printscr') TO PRINTER NOCONSOLE
USE IN screen_capture
SELECT (cArea)