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
Thema durchsuchen
Ansicht
Themen-Optionen

limiting number of instances in Windows terminal server

Ein Thema von imadam · begonnen am 4. Jun 2019 · letzter Beitrag vom 5. Jun 2019
 
imadam

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

AW: limiting number of instances in Windows terminal server

  Alt 5. Jun 2019, 08:28
.. 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
So far, my research gave me:
- I have to list processes in TS session
- I have to get username from TS enviroment which is logged in
and simple compare number of instances in question with number of those processes already running.
Is this wrong approach ?
Yet to figure out how to read logged user and processes over Win32 API .
  Mit Zitat antworten Zitat
 

 

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 07:13 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