>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
----------------------------------
António Tavares Lopes