Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Delete file after ShellExecute() finishes
Message
De
09/07/2003 12:46:03
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Delete file after ShellExecute() finishes
Divers
Thread ID:
00808564
Message ID:
00808564
Vues:
128
I use Gen field to hold doc, pdf, txt, xls and other types of
files in my VFP 7 applicaton.

I use ShellExecute to allow user to view them:
COPY MEMO attachbody TO (m.cFN)

declare integer ShellExecute in SHELL32.DLL ;     
      integer nWinHandle, string cOperation, ;     
      string cFileName, string cParameters, ;     
      string cDirectory, integer nShowWindow   
nres = ShellExecute(0, 'Open', m.cFN, '', '', 1)
This creates temporary file in windows temp directory and opens windows
registered application (adobe acrobat, work, notepad, wordpad etc.) to view
it.

If user quits my application before quitting viewer application, those
temporary files remains in windows temp directory.
This causes a BIG security flaw.

I tried same thing in Outlook Express by opening message attachment.
In this case OE creates temporary file in Temporary Internet Files folder.

However, this file is deleted even if OE is exited before viewer application.

Any idea how to implement same thing in VFP ?
Andrus
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform