Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Print Screen in VFP
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00113820
Message ID:
00164784
Vues:
31
>>I'm trying to add print screen capabilities to a VFP app. I understand that you can copy the contents of a screen to the clipboard with Alt-PrintScrn and that you can paste those contents into a general field in a database. I haven't been able to create a report that prints general fields, though. Is it possible?
>>
>>Or, is there some command or API call that will dump the contents of the clipboard straight to the printer?
>>
>>This app is targeted towards folks who are not necessariliy computer-literate, so I want to make this as simple as possible.
>>
>> TIA,
>> ROB
>
>The best solution I have found is to use the DibApi32 DLL that is part of the WinCap sample on the MSDN CD (also available from the MS web site, search for WinCap). It contains a PrintWindow function that does a screen print.
>
>This is the PrintWindow method from my application class
>
>
>LPARAMETERS tnHWnd, tcJobName
>LOCAL lcJobName
>LOCAL lnRetVal
>
>DECLARE INTEGER PrintWindow IN DibApi32 ;
>	INTEGER HWnd, ;
>	INTEGER fPrintArea, ;
>	INTEGER fPrintOpt, ;
>	INTEGER wxScale, ;
>	INTEGER wyScale, ;
>	STRING @ szJobName
>	
>#DEFINE PW_WINDOW 1
>#DEFINE PW_CLIENT 2
>#DEFINE PW_BESTFIT 1
>#DEFINE PW_STRETCHTOPAGE 2
>#DEFINE PW_SCALE 3
>
>lcJobName = tcJobName + CHR(0)
>lnRetVal = PrintWindow( tnHWnd, PW_WINDOW, PW_STRETCHTOPAGE, 0, 0, @lcJobName)
>IF lnRetVal != 0
>	IF lnRetVal != 6	&& 6 = User canceled printing
>		= MESSAGEBOX("Unable to print the window" + CRLF + ;
>			"PrintWindow API call returned " + STR(lnRetVal), ;
>			MB_ICONEXCLAMATION + MB_OK, ;
>			oApp.cApplicationName)
>	ENDIF
>ENDIF
>RETURN
>
>
I have used this solution and it works pretty good. My question is there anyway that it would only print the active window in the FoxPro screen?
DLC
DLC
"Use the Right Tool for the Job!"
davidandcynthia@email.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform