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

Use of Windows START command

Status
Not open for further replies.

jabhawk

Programmer
Apr 23, 2002
71
US
I was wordering if anyone had used the Windows START command to launch files from within VFP apps. I have a custom application that will take CSV,XLS and other formatted files and load them to tables.

I wanted to allow the user preview ability before the file is loaded. As not all clients will have the same tools loaded I wanted to let Windows open the file in the assosiated application.

Normally from other apps I would use a shell command to run the following command line:
START pathname\filename.ext
The correct application would launch and open the file.

In VFP I issue the command RUN "START ..." and I see a Dos window flash but the file does not open and I get no messages.

I would rather not have to define the Automation calls within the module as it is a small low use tool. Any thoughts or simple code to do this?

Jon B
2000/XP/ME runtime workstations VFP 6.0 SP2

Jonthan A Black
 
SHELLEXECUTE will open the file in the windows associated application

DECLARE INTEGER ShellExecute IN shell32.dll ;
INTEGER hndWin, ;
STRING cAction, ;
STRING cFileName, ;
STRING cParams, ;
STRING cDir, ;
INTEGER nShowWin


cFileName = ***INSERT path+FILE HERE ****
cAction = "open"
nret=ShellExecute(0,cAction,cFileName,"","",1)


for more info - Mike Lewis's site


2nd recommendation for this site in 2 days!!

mrF
 
Mr Lewis - You beat me to it.

As you said Ideal application for the use of shell execute

mrF
 
Thank you all, I have used this before but I was having a senior moment and totaly blanked on the command. They must have slipped me decaf today.
Jon B

Jonthan A Black
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top