PDA

View Full Version : Wondering if theres a way to do this in VB6.


xxvenom
03-08-2005, 01:10 AM
Well..

I was wondering if there is a way to determine if a program is running..and if it is open a different program (which happens to be a macro to open the program that should be running ), and if it's not..do nothing.

I'm not good at VB at all..I webdesign and don't know much about Computer programming :p

Anyways..all help is appreciated.

xv3

oracleguy
03-08-2005, 10:34 PM
This code should help you get a list of all the running processes (aka programs) on the computer. http://www.vbforums.com/showthread.php?t=234340

Then once you get a list of them, you can determine if the program you are looking for is running or not and act accordingly.

Dunna
03-11-2005, 01:50 PM
If the process you are trying to detect is yours, you could do this:

HANDLE hMutex = CreateMutex(NULL, TRUE, "My Mutex");
switch ( GetLastError() )
{
case: ERROR_SUCCESS
break;
default:
{
DoSomethingElse();
break;
}

}