How to determine if an .EXE is running?
-
Hi, I have two identical computers on the network. The VC++ software I wrote can only be running on one of the machines at a time. Is there a way to enumerate or check the exe's running on the other computer. Thanks Tim :rolleyes:
-
Hi, I have two identical computers on the network. The VC++ software I wrote can only be running on one of the machines at a time. Is there a way to enumerate or check the exe's running on the other computer. Thanks Tim :rolleyes:
-
There are several solutions. One solution is COM in a local process would connect to the remote process. The remote process would update its status. A simpler solution is socket. Kuphryn
-
Thanks, I was trying to stay away from COM. I'm not that familiar with it. I thought about using a socket but I wasn't sure if windows had something already for this purpose. Tim :rolleyes:
You could enumerate the processes on the other computer but that would require you have the proper [administrative] rights. It could also be unreliable if someone changed the name of the executable. See http://www.sysinternals.com/[^] for code on enumerating processes and other things. I think a simple socket idea is probably the best.
-
Thanks, I was trying to stay away from COM. I'm not that familiar with it. I thought about using a socket but I wasn't sure if windows had something already for this purpose. Tim :rolleyes:
i have quite a good solution! use the CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, NULL ) to get a complete list of the running processes on the local machine... have a look at msdn under CreateToolhelp32Snapshot, you will find a useful code snippet there.