Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delete file after ShellExecute() finishes
Message
From
09/07/2003 12:46:03
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Delete file after ShellExecute() finishes
Miscellaneous
Thread ID:
00808564
Message ID:
00808564
Views:
126
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
Next
Reply
Map
View

Click here to load this message in the networking platform