Page 1 of 1

What Apps running on Workstation?

Posted: Wed Dec 03, 2014 5:57 am
by dougtanner
Does anyone know how the check what apps are running on a workstation in an xBase++ application? In XP and Windows 7.

Doug

Re: What Apps running on Workstation?

Posted: Wed Dec 03, 2014 8:57 am
by rdonnay
If you are trying to determine if a specific app is running, you can use DC_IsAppRunning().

Re: What Apps running on Workstation?

Posted: Wed Dec 03, 2014 12:37 pm
by dougtanner
Thanks, but I keep getting a "parameter has wrong data type" error using your example in the help screen. In Line DC_ISAPPRUNNING(2364) Calling FINDWINDOWA(2290). I think it is the Class Name of the Window. I have tried:

IF DC_IsAppRunning('XbpDialog',,'MYAPP.EXE',.t.)
IF DC_IsAppRunning('XbpPmtClass',,'MYAPP.EXE',.t.)
IF DC_IsAppRunning('XbpWindow',,'MYAPP.EXE',.t.)
IF DC_IsAppRunning('XbpCrt',,'MYAPP.EXE',.t.)
IF DC_IsAppRunning('XbplWindow',,'MYAPP.EXE',.t.)

Seems I don't know what the class name of my window.

Doug

Re: What Apps running on Workstation?

Posted: Wed Dec 03, 2014 1:04 pm
by bwolfsohn
try it this way...

it's the title of the app..

if is_running({"Password","CUS Auction Management System","Monitor Online Auction(s)","Real-Time Sale Viewing"})
RETURN .f.
endif



*******************
function is_running(aApp)
*******************
local cApp,i
IF valtype(aApp)<>"A"
cApp:=aApp
aApp:={}
aadd(aApp,cApp)
ENDIF
FOR i := 1 TO len(aApp)
IF DC_IsAppRunning('XbpDialog',aApp,,.t.) .OR. DC_IsAppRunning('XbpPmtClass',aApp,,.t.)
IF yes_no3("This application is already running on this machine. Continue ?")
RETURN .f.
else
RETURN .t.
ENDIF
endif
NEXT
return(.f.)