Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
4
Erster Beitrag:
vor 9 Jahren, 7 Monaten
Letzter Beitrag:
vor 9 Jahren, 7 Monaten
Beteiligte Autoren:
Knut Katzner.pcs.crosspost, Udo, KenKnight

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

Startbeitrag von Knut Katzner.pcs.crosspost am 04.11.2008 14:56

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

Antworten:

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


von KenKnight - am 05.11.2008 02:06

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

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

von Knut Katzner.pcs.crosspost - am 05.11.2008 08:56

Hi
You can try follow code:

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


Udo



von Udo - am 05.11.2008 09:41
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.