Page 1 of 1

DC_IsAppRunning

Posted: Mon Sep 22, 2014 10:04 am
by bwolfsohn
Roger,
we're running into a problem with using dc_isapprunning()

the line in our code is:
IF DC_IsAppRunning('XbpDialog',aApp,,.t.) .OR. DC_IsAppRunning('XbpPmtClass',aApp,,.t.)

but, this only works if the application has gotten to the main appwindow. if does not work if the application is still starting up.

is there any way to test for the application exe running in the task manager ? this comes up right away, even before any windows are defined...

Re: DC_IsAppRunning

Posted: Wed Sep 24, 2014 7:03 am
by rdonnay
Brian -

I had a similar problem with an app, and found that the best solution was to create a shell application that calls the main application. A small shell app will load much faster. I then wrote a 1 to the registry.
After the main app is completely started, it writes a 0 back to the registry.

The shell app stays in a loop, reading the registry, waiting to read a 0. It then quits.

I know of no other way to get a list of running procedures.

Re: DC_IsAppRunning

Posted: Wed Sep 24, 2014 8:10 am
by Tom
There is a way to investigate running processes. Take a look at this thread from the "German Xbase Forum", second last message ("TerminateTask"). You can see here how to find out which processes are running - by ProcessID or by EXE name. And even how to kill them (if you have a deadlocked version of your app running, which sometimes happens since QUIT does not always quits the app completely).

http://www.xbaseforum.de/viewtopic.php?f=20&t=6511

Re: DC_IsAppRunning

Posted: Wed Sep 24, 2014 1:13 pm
by Cliff Wiernik
Based on what I saw searching for an answer, Brian would be looking for something like the last example. His case is where the application is running but no window is present. You are checking by the process name.

Would have to investigate it some more to find out how to adapt it.