Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Printscreen Routine
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Printscreen Routine
Divers
Thread ID:
00062450
Message ID:
00062450
Vues:
79
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
Everything we see or seems
Is but a dream within a dream
- Edgar Allen Poe
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform