AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Win32/Win64 API (native code) limiting number of instances in Windows terminal server

limiting number of instances in Windows terminal server

Ein Thema von imadam · begonnen am 4. Jun 2019 · letzter Beitrag vom 5. Jun 2019
Antwort Antwort
Schokohase
(Gast)

n/a Beiträge
 
#1

AW: limiting number of instances in Windows terminal server

  Alt 4. Jun 2019, 22:29
Do you use a mutex?

If yes, a global or a session mutex?
  Mit Zitat antworten Zitat
imadam

Registriert seit: 4. Jun 2019
12 Beiträge
 
#2

AW: limiting number of instances in Windows terminal server

  Alt 5. Jun 2019, 06:02
Do you use a mutex?

If yes, a global or a session mutex?
This is new app. Starting from scratch. So Delphi best practice should be applied here .
  Mit Zitat antworten Zitat
Schokohase
(Gast)

n/a Beiträge
 
#3

AW: limiting number of instances in Windows terminal server

  Alt 5. Jun 2019, 07:29
Do you use a mutex?

If yes, a global or a session mutex?
This is new app. Starting from scratch. So Delphi best practice should be applied here .
You already have a working solution for
We are able to fix this on Windows to have only one instance of application running
so please show us it and we can tell yo how to change it for running on TS
  Mit Zitat antworten Zitat
imadam

Registriert seit: 4. Jun 2019
12 Beiträge
 
#4

AW: limiting number of instances in Windows terminal server

  Alt 5. Jun 2019, 07:35
Do you use a mutex?

If yes, a global or a session mutex?
This is new app. Starting from scratch. So Delphi best practice should be applied here .
You already have a working solution for
We are able to fix this on Windows to have only one instance of application running
so please show us it and we can tell yo how to change it for running on TS
I read my post again. It is bit confusing . So we started with prototype. Playing around. We were able limit this to one instance of the app on Windows Desktop. However, we would like to be able to set number of instances (like 3 for user 1, 1 for user 2) in Terminal server. Also, if is there some best practice for Delphi developing this kind of apps, it would be great if somebody can share it. Let me know what to share ...
  Mit Zitat antworten Zitat
Schokohase
(Gast)

n/a Beiträge
 
#5

AW: limiting number of instances in Windows terminal server

  Alt 5. Jun 2019, 08:10
We were able limit this to one instance of the app on Windows Desktop.
I guess you use a mutex for that.

For Terminal Server (or even in generell) do not use a global mutex as this would be for the whole system.

For an application with one instance you need one mutex.
For an application with two instances you need two mutexes.
...
  Mit Zitat antworten Zitat
Klaus01

Registriert seit: 30. Nov 2005
Ort: München
5.780 Beiträge
 
Delphi 10.4 Sydney
 
#6

AW: limiting number of instances in Windows terminal server

  Alt 5. Jun 2019, 08:14
.. but whith muutexes you have to decide how many instances can be started - at design time.
These settings are then based on application level - not on user level.

best regards
Klaus
Klaus
  Mit Zitat antworten Zitat
mjustin

Registriert seit: 14. Apr 2008
3.010 Beiträge
 
Delphi 2009 Professional
 
#7

AW: limiting number of instances in Windows terminal server

  Alt 5. Jun 2019, 08:20
Did you try TJvAppInstances already? It is designed for limiting app instances, and it allows to set the maximum number of simultaneous instances using the property MaxInstances. I am not soure however if it is also suited for a TS.
Michael Justin
habarisoft.com
  Mit Zitat antworten Zitat
Benutzerbild von Dalai
Dalai
Online

Registriert seit: 9. Apr 2006
1.684 Beiträge
 
Delphi 5 Professional
 
#8

AW: limiting number of instances in Windows terminal server

  Alt 5. Jun 2019, 08:22
.. but whith muutexes you have to decide how many instances can be started - at design time.
Uh, no. A Mutex is based on a name, a string, and strings can be built at runtime. Example from one of my projects where the mutex name is based on a concatenation of several strings:hMutex:= CreateMutex(nil, True, PRODUCTNAME + PRODUCTNAME + PRODUCTCOPYRIGHT); Using usernames and an appended counter instead is trivial. Reading the information that user A can start the application X times and user B can start it only once is trivial, too (Registry, INI, XML, whatever). Use that in conjunction with a for-loop that tries to create mutexes until either all of them already exist, or the maximum allowed instances are reached, and you have reached your goal.

Regards
Dalai
  Mit Zitat antworten Zitat
Antwort Antwort

 
Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 21:25 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz