Welcome! Log In Create A New Profile

Advanced

[WinDev12] How to determine how many instances of an applicate are

Posted by Knut Katzner.pcs.crosspost 
Knut Katzner.pcs.crosspost
[WinDev12] How to determine how many instances of an applicate are
November 04, 2008 03:56PM
Hello to all,

Is there a way to determine how many instances of an application are runnung
on a PC?

I know that under Win16 were these function GetModuleHandle() and
GetModuleUsage(). Together they gave you the number of runnung instances of an
application.

I want to know this because limit the running instanes of our application on
an Windows Terminal Server or in Windows XP or Vista.

Thank you for an answer in advanced.

Knut
Message forwarded from pcsoft.us.windev
If you're trying to determine how many instances within a single users process space, then You could use EnumWindows() with a "CallBack" on a timer to see how many of your apps are running or you could use a Memory Zone technique.

However, if you are trying to determine how many instances of your app are running across ALL users, that will be a bit of a problem as it would require administrative privileges to access.

If I'm going to implement something like this across all users, I would use a common data table to increment / decrement at program init and close. If using Hype File Client Server you could use HlistConnectedUser to return a list of connected users.

HTH

Cheers!
Ken
Knut Katzner.pcs.crosspost
Re: [WinDev12] How to determine how many instances of an applicate
November 05, 2008 09:56AM
Hello Ken,

> If you're trying to determine how many instances within a single users process space, then You could use EnumWindows() with a "CallBack" on a timer to see how many of your apps are running or you could use a Memory Zone technique.
> However, if you are trying to determine how many instances of your app are running across ALL users, that will be a bit of a problem as it would require administrative privileges to access.
> If I'm going to implement something like this across all users, I would use a common data table to increment / decrement at program init and close. If using Hype File Client Server you could use HlistConnectedUser to return a list of connected users.
> ...

Thanks for your help.

First I will try the EnumWindows(). But to use a data table to count the
Number of useres should be the better way, especially when it comes to count
all running instances across all users of a pc.

Knut


Message forwarded from pcsoft.us.windev

Hi
You can try follow code:

l_Count is int
l_Count = ExeRunning("c:\myFolder\MyProg.exe")
Info("Myprog is running: " +l_Count)


Udo

Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: