Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Code to Print a VFP Form
Message
De
05/02/2019 04:46:42
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01665906
Message ID:
01665915
Vues:
82
J'aime (1)
>Would anyone know how to print a portion or all of a screen image directly to a printer from a complied VFP application? I suspect it can be done by a Windows API call but don't know what that would be. If there is an API call for this, example code would help.
>
>Also, I'm assuming this isn't something that can be done with native VFP coding. Please confirm or provide code for that.
>
>TIA,
>
>Dave L.

This code will copy the current form to the clipboard:
DECLARE INTEGER keybd_event IN Win32API ;
        INTEGER, INTEGER, INTEGER, INTEGER
*
* Do an Alt-Printscreen
*
#DEFINE VK_LMENU 164
#DEFINE VK_SNAPSHOT 44
#DEFINE KEYEVENTF_EXTENDEDKEY 1
#DEFINE KEYEVENTF_KEYUP 2
DOEVENTS
keybd_event( VK_LMENU,    0, KEYEVENTF_EXTENDEDKEY, 0 )  && key down
INKEY(0.01)
keybd_event( VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY, 0 )
INKEY(0.01)
keybd_event( VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY + KEYEVENTF_KEYUP, 0 )
INKEY(0.01)
keybd_event( VK_LMENU,    0, KEYEVENTF_EXTENDEDKEY + KEYEVENTF_KEYUP, 0 )
DOEVENTS
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform