Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

printWindow API Call

Status
Not open for further replies.

JudyBarer

Programmer
Jan 13, 2004
23
US
I saw in advisor magazine a suggestion to use printwindow() from the
windows api to print the current screen. It also says that you have to
download Palfade.exe which contains the DIBAPI32.DLL . If I wanted to
use this in my apps how would I install the Dll on my user's machines?
Can it be included in the installation useing Installshield express?

Thanks
Judy
 
Hi Judy,

Code:
********************************** 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 nRetVal
endfunction
*Got this from someone on Universal Thread  and it works great.
*Any thanks should go to them.

Don't remember where to get dibapi32.dll, though. It won't register, just put it in the path.

Regards,

Mike
 
JudyBarer

An alternative might be the suggestion found in faq184-4912.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Thank You for responding. I tried the code in FAQ184-4912
and it seems to work really well. Is anyone else using that code and have you seen any problems?

Thanks
Judy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top