Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
PDF file viewing
Message
 
To
25/10/2003 08:33:27
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00842586
Message ID:
00842587
Views:
12
Please tell me a way how to view PDF file in VFP 6.0

From the download area (or api area, I can't remember) -- the best way is to use the shellexecute() api.

Kevin
**Shell API for Viewing
**ShellAPIViewing.prg
**  The only problem is that when a file is not ASSOCIATED there is no warning or message available
**  Shellexecute returns integers which I don't know what the values represent.

LPARAMETERS lcLink, lcAction, lcParms

** definitions for nShowWindow variable
#define SW_HIDE             0
#define SW_SHOWNORMAL       1
#define SW_NORMAL           1
#define SW_SHOWMINIMIZED    2
#define SW_SHOWMAXIMIZED    3
#define SW_MAXIMIZE         3
#define SW_SHOWNOACTIVATE   4
#define SW_SHOW             5
#define SW_MINIMIZE         6
#define SW_SHOWMINNOACTIVE  7
#define SW_SHOWNA           8
#define SW_RESTORE          9
#define SW_SHOWDEFAULT      10
#define SW_FORCEMINIMIZE    11
#define SW_MAX              11

lcAction=IIF(empty(lcAction),"Open", lcAction)
lcParms=IIF(empty(lcParms),"",lcParms)

*!*	kve 1/30/01 nshowWindow was Integer
DECLARE integer ShellExecute ;
	in shell32.dll ;
	integer nWinHandle , ;
	string  cOperation, ;
	string  cFileName, ;
	string  cParameters, ;
	string  cDirectory, ;
	integer nShowWindow

DECLARE Integer FindWindow ;
	in win32api ;
	string cNull , ;
	string cWinName

IF empty(lcLink)
	lcLink=getfile()
ENDIF

IF not empty(lcLink)
*!*	kve 1/30/01:  switched nShowWindow from 1 to 0 to see what happens
	lcResult= ShellExecute(FindWindow(0,_screen.caption), ;
		lcAction, lcLink, lcParms, sys(2023), 3)   
	wait window timeout 2 "Opening File "+alltrim(lcLink)+".  The file will display if it associated with an application."
ENDIF
Kevin Emmrich
www.jkt9000.com
Previous
Reply
Map
View

Click here to load this message in the networking platform