Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Executing an .exe (not vfp)
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00773495
Message ID:
00774542
Vues:
12
First way:
#DEFINE SW_SHOWMAXIMIZED 3

DECLARE INTEGER WinExec IN kernel32;
	STRING  lpCmdLine, INTEGER nCmdShow

= WinExec ("C:\Program Files\Movie Maker\moviemk.exe", SW_SHOWMAXIMIZED)
Second way:
#DEFINE SW_SHOWMAXIMIZED 3

DECLARE INTEGER ShellExecute IN shell32;
	INTEGER hwnd, STRING lpOperation,;
	STRING lpFile, STRING lpParameters,; 
	STRING lpDirectory, INTEGER nShowCmd

= ShellExecute (0, "open",;
	"C:\Program Files\Movie Maker\moviemk.exe",;
	"", "", SW_SHOWMAXIMIZED)
Third way: using CreateProcess Win API function.
Fourth way: using Windows Shell object:
#DEFINE EXEC_NOWAIT  0
#DEFINE EXEC_AND_WAIT 1
loShell = CreateObject ('WScript.Shell')
loShell.Run ("notepad c:\temp\myfile.txt", 1, EXEC_NOWAIT)
Code samples on "Using Win32 Functions in Visual FoxPro":

Running external applications from VFP using CreateProcess
http://www.news2news.com/vfp/?example=3&function=3

Running an external program from FoxPro and waiting for its termination
http://www.news2news.com/vfp/?example=377&function=3

Running external applications from VFP using WinExec
http://www.news2news.com/vfp/?example=2&function=2

Using Shell for performing operations on files
http://www.news2news.com/vfp/?example=93&function=138
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform