Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Run command long file name
Message
De
24/08/2006 13:04:36
 
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:
01148274
Vues:
15
And it would avoid the need to see the ugly DOS box window when it runs, probably a better solution all the way around for you.


>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
>
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform