Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Print Screen in VFP
Message
 
To
04/12/1998 16:51:30
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00113820
Message ID:
00164633
Views:
23
Mark,
I've tested the dll with VFP 5 and VFP 6. I don't think you will be able to call the dll from FP 2.6, Since FP 2.6 is a 16 bit program. Your best bet is to get hold of a screen print utility.

>>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
>>>
>>>
Steve Ruhl
CitiMortgage, Inc.
steven.ruhl@citibank.com Office
Steve@steven-ruhl.com Home
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform