FOXPRO TO XBASE++ CONVERSION
FOXPRO TO XBASE++ CONVERSION
Hi Roger
How can I convert this Foxpro function to Xbase++ ?
FUNCTION IsExeRunning(tcName, tlTerminate)
LOCAL loLocator, loWMI, loProcesses, l CREATEOBJECT('WBEMScripting.SWBEMLocator')
loWMI = loLocator.ConnectServer()
loWMI.Security_.ImpersonationLevel = 3 && Impersonate
loProcesses = loWMI.ExecQuery([SELECT * FROM Win32_Process WHERE Name = '] + tcName + ['])
llIsRunning = .F.
IF loProcesses.Count > 0
FOR EACH loProcess in loProcesses
llIsRunning = .T.
IF tlTerminate
loProcess.Terminate(0)
ENDIF
ENDFOR
ENDIF
RETURN llIsRunning
Thanks
Joe
How can I convert this Foxpro function to Xbase++ ?
FUNCTION IsExeRunning(tcName, tlTerminate)
LOCAL loLocator, loWMI, loProcesses, l CREATEOBJECT('WBEMScripting.SWBEMLocator')
loWMI = loLocator.ConnectServer()
loWMI.Security_.ImpersonationLevel = 3 && Impersonate
loProcesses = loWMI.ExecQuery([SELECT * FROM Win32_Process WHERE Name = '] + tcName + ['])
llIsRunning = .F.
IF loProcesses.Count > 0
FOR EACH loProcess in loProcesses
llIsRunning = .T.
IF tlTerminate
loProcess.Terminate(0)
ENDIF
ENDFOR
ENDIF
RETURN llIsRunning
Thanks
Joe
Re: FOXPRO TO XBASE++ CONVERSION
this was generated from my Xbase++ App.unixkd wrote:loProcesses = loWMI.ExecQuery([SELECT * FROM Win32_Process WHERE Name = '] + tcName + ['])
it does include all Property so just take what you need. ... i wonder why you want to use WMI COM Interface

Express++ have
Code: Select all
FUNCTION DC_IsAppRunning( cClass, cTitle, cFile, lRestore )
greetings by OHR
Jimmy
Jimmy
Re: FOXPRO TO XBASE++ CONVERSION
Hi Jimmy
The Process Class has :Terminate() Method, How can I use it
The Process Class has :Terminate() Method, How can I use it
Re: FOXPRO TO XBASE++ CONVERSION
hm ... i can see "TerminationDate" ... but they are all Property no Method.unixkd wrote:The Process Class has :Terminate() Method, How can I use it
greetings by OHR
Jimmy
Jimmy
Re: FOXPRO TO XBASE++ CONVERSION
Check the "execute a method" of WMI code creator as shown above and you will see the 6 methods exposed by object.
Thanks
Joe
Re: FOXPRO TO XBASE++ CONVERSION
you are right but my Xbase++ WMI Generator does not know how to "detect" WMI Method ... only Property.unixkd wrote:Check the "execute a method" of WMI code creator as shown above and you will see the 6 methods exposed by object.
greetings by OHR
Jimmy
Jimmy
Re: FOXPRO TO XBASE++ CONVERSION
If you need to kill a window you could use the TASKKILL command.
The eXpress train is coming - and it has more cars.
Re: FOXPRO TO XBASE++ CONVERSION
Hi Roger
The RunShell( '/IM Excel.exe', 'TaskKill.Exe' ) gives operating system error 2
I think the foxpro sample will give the desired result if it can be converted to Xbase++
Thanks.
The RunShell( '/IM Excel.exe', 'TaskKill.Exe' ) gives operating system error 2
I think the foxpro sample will give the desired result if it can be converted to Xbase++
Thanks.
Re: FOXPRO TO XBASE++ CONVERSION
try this Code to close Excel
- Attachments
-
- CLOSEIT.ZIP
- Xbase++ Source
- (1.08 KiB) Downloaded 1016 times
greetings by OHR
Jimmy
Jimmy
Re: FOXPRO TO XBASE++ CONVERSION
Hi Jimmy
SendMessageA() not found in CLOSEIT
Thanks
SendMessageA() not found in CLOSEIT
Thanks