Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Run command long file name
Message
 
À
23/08/2006 17:45:55
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Divers
Thread ID:
01148006
Message ID:
01148077
Vues:
16
http://www.news2news.com/vfp/?example=2
apparently WinExec allows one to avoid using foxrun.pif. Seems to work just fine.
#DEFINE SW_HIDE 0 
#DEFINE SW_SHOWNORMAL 1 
#DEFINE SW_SHOWMINIMIZED 2 
#DEFINE SW_SHOWMAXIMIZED 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 

DECLARE INTEGER WinExec IN kernel32  STRING lpCmdLine, INTEGER nCmdShow 
LOCAL cCmdLine, nResult 

m1 = "c:\program files\newbie\newbie.exe" 
m2 = " /login admin /password asdfasdf" 
m3 = " /script c:\americanbulls.nbl"
m4 = " /autoclose true" 

m5 = (m1) + (m2) + m3 + m4

myCommand = m5

* for security reasons make sure the application name 
* is enclosed in quotation marks 
cCmdLine = myCommand

*!*    cCmdLine = "C:\Program Files\Microsoft Office\Office\WINWORD.EXE" 

nResult = WinExec(cCmdLine, SW_SHOWDEFAULT) 

IF nResult <= 31 
    = MESSAGEBOX("WinExec failed with an error: " +; 
        LTRIM(STR(nResult)) + "     ", 48) 
ENDIF  
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform