Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form to printer
Message
From
14/05/2004 08:19:48
 
 
To
13/05/2004 22:26:43
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00903942
Message ID:
00904017
Views:
28
Add the following function to your procedures library and call it to print the screen.
*********************************
* Print the current window
function printscr()

	DECLARE INTEGER GetDesktopWindow IN Win32api

	DECLARE INTEGER PrintWindow IN DibApi32 ;
	INTEGER HWnd, ;
	INTEGER fPrintArea, ;
	INTEGER fPrintOpt, ;
	INTEGER wxScale, ;
	INTEGER wyScale, ;
	STRING @ szJobName

	LOCAL nRetVal,cJobName && title you want to show when printing

	cJobName = 'Print Screen' && or whatever - this could be passed in as a parameter, also.

	nRetVal = PrintWindow(GetDesktopWindow(),1,1,0,0,@cJobName)
	IF nRetVal != 0
		IF nRetVal != 6 && 6 = User canceled printing
			MESSAGEBOX("Unable to print the window" + chr(10) + ;
			"See System Administrator " + STR(nRetVal),48, ;
			"FUBA Print Screen ")
		ENDIF
	ENDIF

RETURN
Got this from someone on UT and it works great. Any thanks should go to them.

Gaylen

>How can i send a complete form directly to the printer in VFP8...or capture the form to a bmp or jpg...
>
>TIA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform