Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can i know a .exe program had open
Message
 
 
To
20/10/2007 11:13:52
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01262342
Message ID:
01262354
Views:
13
>Hi everyone,
>
>I need to run a application (.exe) at the beginning of system. User maybe quit the system or access it later again.
>
>How can i know that application are still running in window ( if its ready running in computer, i not need to access it again )

See Is a Windows applications running? File #9292 or you can use WMI
loLocator		= CREATEOBJECT('WBEMScripting.SWBEMLocator')
loWMI			= loLocator.ConnectServer() lcExeName = "Firefox.exe"
llIsRunning = .F.
loProcesses	= loWMI.ExecQuery([SELECT * FROM Win32_Process WHERE Name = '] + lcExeName +['])

FOR EACH loProcess in loProcesses
	llIsRunning = .T.
ENDFOR

IF llIsRunning 
	? lcExeName + " is running"
ELSE
	? lcExeName + " is NOT running"
ENDIF	
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform