Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Launching Files in Default Viewers
Message
 
À
11/07/2005 06:06:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Versions des environnements
Visual FoxPro:
VFP 6
OS:
Windows XP SP2
Divers
Thread ID:
01031122
Message ID:
01031125
Vues:
17
>Are there any controls to enable files (.doc,.xls,.txt etc etc) to be launched in there default assocatied program in Windows XP??
   DECLARE INTEGER ShellExecute IN SHELL32.DLL INTEGER nWinHandle,;
                                               STRING cOperation,;
                                               STRING cFileName,;
                                               STRING cParameters,;
                                               STRING cDirectory,;
                                               INTEGER nShowWindow
    result = ShellExecute(0, 'Open', YourFullFileNameWithExtention , '', '', 1)
    DO CASE
       CASE result ==  0	     && The system is out of memory or resources.
            msg = "The system is out of memory or resources."
       CASE result ==  2	     && Bad Association (for example, invalid URL)
            msg = "Bad Association"
       CASE result == 29	     && Failure to load application
            msg = "Failure to load application"
       CASE result == 30	     && Application is busy 
            msg = "Application is busy "
       CASE result == 31         && No application association
            msg = "No application association"
   ENDCASE
   IF INLIST(result, 0, 2, 29, 30, 31)
      GetMessage(msg, 0 + 64, "ShellExecute")
   ENDIF
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform