Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP.exe to different VFP.exe
Message
De
12/02/2021 16:43:18
Mike Yearwood
Toronto, Ontario, Canada
 
 
À
12/02/2021 16:20:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01678195
Message ID:
01678198
Vues:
70
>>Hey all
>>
>>I am trying to have a launcher find a running vfp.exe (call it target.exe) and switch to it, if it has the right startup folder. If not, I want to launch that one. I can find examples to get the target exe by window title. That won't work as the app changes the title frequently.
>>
>>I think I want to access the _docmd of the target.exe so I can check if it is the correct target.
>>
>>So I want to iterate through all running targets, but check their startup folder. If none are running, or not the one for this particular folder, then I want to start them. I already have the way to start them with shellexecute.
>
>Mike,
>
>You can get information about a process from the Win32_Process class.
>
>Using Marco Plaza's WMIQuery little gem:
>
>
>LOCAL Processes AS Object
>LOCAL Process AS Object
>
>m.Processes = WMIQuery("Win32_Process")
>
>FOR EACH m.Process IN m.Processes.Items
>
>	IF m.Process.Name == "vfp9.exe"
>		? "VFP9 is running at", m.Process.ExecutablePath
>		EXIT
>	ENDIF
>
>ENDFOR
>
Looks good. Looks like wmiquery won't work in vfp6.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform