Processes and Application

  • Thread starter Thread starter Nicolas
  • Start date Start date
N

Nicolas

I want to check if an application is running.
The Application is showing inthe task manager applications and processes
HOWEVER there is no process ID for this application. Don't ask me why or how
but then when I do the System.Diagnostics.Process.GetProcesses this
application doesn't appear in the list. I also try with WMI and
(ManagementClass("Win32_Process")) doesn't show either.

This application is a DDE Server and has a window showing on the screen.

Why it is not showing in the applications/processes list?
How can I then check if it is already started?

Thanks
 
Nicolas said:
I want to check if an application is running.
The Application is showing inthe task manager applications and processes
HOWEVER there is no process ID for this application. Don't ask me why or
how
but then when I do the System.Diagnostics.Process.GetProcesses this
application doesn't appear in the list. I also try with WMI and
(ManagementClass("Win32_Process")) doesn't show either.

This application is a DDE Server and has a window showing on the screen.

Why it is not showing in the applications/processes list?
How can I then check if it is already started?

Are you sure that you have the correct EXE file name?

Do other processes appear in the list? What about Task Manager and Process
Explorer?

Process Explorer:
http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx

Is it 16/32/64 bit process? 16 Bits require a different way to get the file
name, and I am not sure if System.Diagnostics.Process.GetProcesses()
supports it. You usually get NTVDM.EXE instead, which is the host process
for 16 Bits. Depending on configuration, you can get one NTVDM.EXE for all
running 16 bits apps, or one for each. See this article if you need to
enumerate 16 bits processes. It's for VB6, so you need to convert it:

How To Enumerate 16-bit Tasks on Window NT Using Visual Basic
http://support.microsoft.com/kb/242416

The only situation I could think of that prevents a process name from being
obtained is some copy protection software. You can still get the process
ID(if you use the Windows API directly), but you can't get the file name at
least when using GetModuleFileNameEx(). I am not sure about other functions,
such as WTSEnumerateProcesses(). GetModuleFileNameEx() requires
PROCESS_VM_READ permission, which some could disable it as a form of copy
protection.

I haven't used System.Diagnostics.Process.GetProcesses, so I don't know the
underlying function(s) it's using.
 
Back
Top