Information générale
Catégorie:
Codage, syntaxe et commandes
>>I have the need to call another VFP EXE from within a program. Presently we check to see if the EXE is running. If not, then use the SHELLEXECUTE to pass parameters and run the EXE.
>>If it is running, the EXE is brought to the front in a normalized state. Question I have is how can I best pass a new parameter to the EXE when it is already running?
>
>Hi Ronald
>VFP Exes get their "command arguments" only on enter (as parameters of the main procedure, or the init event on the startup form). So there's no such thing as "pass a new parameter while running"... unless you use DDE (yeah, the old "obsolet" protocol) setting your running app as "DDE server". If you wish to do so take a look at the DDExxxxx functions.
>
>Maybe it would be better to implement a COM component in VFP7, and call it with CREATEOBJECT.. or communicate with messages (MSMQ or file based) between your VFP applications.
>
>HTH and bye
>Jose.
Thanks for the reply. Let me ask, if the second program is still running, is there a way to find out if it has the focus after I issue the 'bring to front'? What I am attempting to do is have the user fire the second program, go back to the first and continue. Then when the go back to the other application, I would like to beable to trap at that point. I have tried to check in the Activate, Show, and Got focus, but can not get response unless I have the user do some activity on a form of the secondary program.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement