Discussion Locked

Program Running Check

0 helpful
8 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi,
I was curious as to what ways there are to check if a program is running, like say with a batch file. Thanks.

8 replies

by tink

What OS are you running? If you are using Windows 2000/NT, you can open up Task Manager and click on Applications or Processes to see what Applications or Processes are currently running.

by bfishell

I am running Windows 9X. What I want to do is to write a program to keep an application running if the application would bomb out.

by sl-campbell

If I understand this right, then this wouldn't be advisable, unless the user is never allowed to end the program.

There is an API call that can be used to check if a certain program is already running, and, in a program, you could start the application that you are taking about and check if it is still running. But, what if the app. didn't "Bomb out", but the user just decided to end the application? How do you check for this?

Start a program and wait until it ends:
Private Declare Function GetModuleUsage Lib "Kernel32" Alias "GetModuleUsage" (ByVal hModule As Integer) As Integer

See if a program is (still) running:
API calls Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

you can go to:
http://www.google.com

and find more.

Post a comment to your question if you still want more info, and I will respond with a comment if my question hasn't been rejected yet....

This discussion is closed to new replies.