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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows Viewer & VFP9

Status
Not open for further replies.

paulvdwa

Programmer
Jan 25, 2006
11
0
0
BE
How can I start the Windows Viewer from within VFP9?

Regards

Paul
 
Hi Mike,

If you dubbleclick on a*.JPG file in the Explorer, a "Windows viewer for pictures and.. " is opened en you can see the picture.

regards

Paul
 
Try something like this:

Code:
Browser("c:\myfolder\myjpeg.jpg")


FUNCTION BROWSER
	PARAMETER m.FILENAME,m.LINEPARAMS
	LOCAL LNRETVAL, LCOPERATION
	PRIVATE m.FILENAME,m.LINEPARAMS
	LCOPERATION = "Open"
	IF PCOUNT() < 2
		m.LINEPARAMS = ""
	ENDIF
	IF MYFILE(m.FILENAME)
		DECLARE INTEGER ShellExecute IN SHELL32.DLL ;
			INTEGER handle,;
			STRING @sFile,;
			STRING @lp,;
			STRING @DIR,;
			STRING @dir1,;
			INTEGER ncmd
		LNRETVAL = SHELLEXECUTE(0, LCOPERATION, m.FILENAME, m.LINEPARAMS, "", 1)
	ELSE
		MESSAGEBOX("Unable to locate the specified file : "+m.FILENAME,48,"Problem")
	ENDIF
	RETURN(.F.)

Regards

Griff
Keep [Smile]ing
 
Thank you, Mike, it's working fine
regards, Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top