Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Print Screen in VFP
Message
De
04/12/1998 16:51:30
 
 
À
04/12/1998 16:09:39
Raymond Humphrys
Michigan Department of Community Health
Bath, Michigan, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00113820
Message ID:
00164293
Vues:
29
>Thanks for the Method. I can't find that dll anywhere. Where did you find it?
>
>Thanks,
>
>ray
>>>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,
Can this code work on FP 2.6

mark oliva



>>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
>>
>>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform