Page 1 of 1

dc_isapprunning()

Posted: Tue Dec 29, 2015 11:59 am
by bwolfsohn
Some issues with dc_isapprunning()

the documentation shows an example:

IF DC_IsAppRunning('XbpDialog',,'MYAPP.EXE',.t.)
RETURN .f.
ENDIF


but, this will not run... the second parameter (title) must be used.

if the title doesn't match EXACTLY, it never gets to this code further down in the function:

if !Upper( cTitle ) $ Upper( cWinTitle ) .and. !Upper( cFile ) $ Upper( cWinFile )
Return( .f. )
End

This function now requires an exact match in the title..

a partial match in the title, or using the filename would be a major improvement...

We were hoping to display the appsize in the titlebar after the app name..

Re: dc_isapprunning()

Posted: Tue Dec 29, 2015 12:29 pm
by rdonnay
If you look at the source code for DC_IsAppRunning() it makes several calls to Windows API functions.

I have not yet found a better way to do this.

Re: dc_isapprunning()

Posted: Tue Dec 29, 2015 12:51 pm
by bwolfsohn
rdonnay wrote:If you look at the source code for DC_IsAppRunning() it makes several calls to Windows API functions.

I have not yet found a better way to do this.
the code i included in my response was from the source....

Maybe jimmy will jump in on this one...

Re: dc_isapprunning()

Posted: Tue Dec 29, 2015 2:36 pm
by Auge_Ohr
bwolfsohn wrote:Maybe jimmy will jump in on this one...
you can try this : WildFindWindow.zip

Re: dc_isapprunning()

Posted: Wed Dec 30, 2015 5:14 pm
by Auge_Ohr
does it help ?

other Solution : get Array of Tasklist and scan for your Application
TASKS.ZIP
pure Xbase++
(6.48 KiB) Downloaded 794 times
Note : c:\exp19\Source\Dclipx\_dcfunct.prg does have same DLL Function !

Re: dc_isapprunning()

Posted: Sat Jan 02, 2016 1:46 pm
by messaoudlazhar
Hi,

I use this function and it works very well:
IsApprunning (Namexe, Title, lRestore)
you have the choice between a single parameter (exe Name or Title) or both.


Attached is a text file containing the source, you can adapt it to therefore replace DC_Isaprunning Function

Best regards,

Messaoud Mohamed Lazhar