Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Printscreen Routine
Message
From
01/12/1997 11:54:22
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00062450
Message ID:
00063052
Views:
40
Thanks for your help George, I never would have thought to do something like this (or known how)! This would seem to be faster than using OLE to run Word to print the clipboard. I'm going to play with this a bit, but I suspect I may end up using a combination of 'your' code and Vladimir Shevchenko's Sysinfo class.
Dave

>Dave,
>Here is what I have. I don't know who originally came up with this but I can't take credit...it does work for me though.
>
>I have listed below a program I call printscr.prg. I have this as a procedure file in one of my apps. I then have a right click short-cut menu that the user can choose print screen from that calls this program. The only requirement is that the MS 'Edit' menu must be available and active for this to work. Hope this helps.
>
>** Printscr.prg -- Print screen routine.
>LOCAL cAlias, tabused
>IF USED(ALIAS())
> cAlias=ALIAS()
> tabused=.T.
>ELSE
> tabused=.F.
>ENDIF
>
>** Declare Win32API Command:
>DECLARE INTEGER keybd_event IN Win32API;
> INTEGER, INTEGER, INTEGER, INTEGER
>
>** Execute and alt-printscreen to capture active window
>keybd_event(44, 0, 0, 0)
>
>** On report from we print a bitmap from a field so create cursor
>CREATE CURSOR screen_capture (SCREEN G)
>APPEND BLANK
>IF tabused
> SELECT(cAlias)
>ENDIF
>
>** Copy bitmap outside of visible work area
>DEFINE WINDOW screen_capture FROM 200,200 TO 203,203
>MODIFY GENERAL screen_capture.SCREEN NOWAIT WINDOW screen_capture
>KEYBOARD "{CTRL+V}{CTRL+W}" CLEAR
>
>** Release temp window
>RELEASE WIND screen_capture
>
>DOEVENTS
>
>IF !EMPTY(screen_capture.SCREEN)
> SELECT screen_capture
> REPORT FORM .\reports\printscr.frx TO PRINTER NOCONSOLE
>ELSE
> WAIT WINDOW 'Sorry, you cannot do a Print Screen of this form.'
>ENDIF
>USE IN screen_capture
>IF tabused
> SELECT(cAlias)
>ENDIF
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform