Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
RUN command
Message
 
To
14/05/1998 09:17:02
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00099389
Message ID:
00099424
Views:
19
>I am issuing the command: RUN progname filename. This works fine, but how do I load a different filename without creating another instance of progname? e.g. Somehow I need to check to see if progname is already running. I have tried RUNning filename much like dblclicking filename in Windows95, but this receives the error Bad command.
>
>Thanks.

Tom,

In the solution I'm about to propose, some of this depends on the application. For example, this solution will load a new document into an existing instance of Word 97 or run it and load it, but start a new instance for a notepad file. Try this:
DECLARE INTEGER ShellExecute IN Shell32;
  INTEGER hwnd, STRING @lpOperation, STRING @lpFile,;
  STRING @lpParameters, STRING @lpDirectory, SHORT nshow
* lcfile = your file
* lcpath = the working directory
lcop = 'open'
lcparms = ""
* Restore the application to its last
* size and position
lnshow = 9
* If lnresult is greater than 32 the function succeeded
lnresult = ShellExecute(0, @lcop, @lcfile, @lcparms, @lcpath, lnshow)
hth,
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform