Lazarus

Announcements => Third party => Topic started by: LuizAmérico on April 18, 2011, 03:29:21 am

Title: UniqueInstance 1.0 released
Post by: LuizAmérico on April 18, 2011, 03:29:21 am
Hi,

After almost four years since the last release i'm proudly to announce a new version of Unique Instance component.

More information in http://wiki.lazarus.freepascal.org/UniqueInstance

The news:

    * Fix application being detected as running after a crash under unix
    * Fix crash when compiling with Gtk2 widgetset
    * Set default values of published properties
    * Optimizations and code clean up
    * New icon
Title: Re: UniqueInstance 1.0 released
Post by: Takeda on April 18, 2011, 05:51:04 am
Cool.. :)
I love it..  :D

I hope it will works in my projects. Amen.

Thank you for your times to built this component, Sir.
Title: Re: UniqueInstance 1.0 released
Post by: michaelthuma on April 18, 2011, 10:10:00 am
Thank you, well done!
Title: Re: UniqueInstance 1.0 released
Post by: krexon on April 18, 2011, 03:39:10 pm
Is it working in terminal services environment?
I have one windows server and 5 users which launch ie. app.exe through RDP protocol (Jestro Cocpit Client - similar to Citrix Client)
When I check server's task manager I see 5 instances of app.exe. But I have one application I would like not to run more than once. I wrote procedure to check unique instances but it doesn't work. It doesn't see other processes, only from my session.
Title: Re: UniqueInstance 1.0 released
Post by: LuizAmérico on April 18, 2011, 06:03:23 pm
Quote
Is it working in terminal services environment?
I have one windows server and 5 users which launch ie. app.exe through RDP protocol (Jestro Cocpit Client - similar to Citrix Client)

Not tested since i don't have such setup.

You can test yourself. I'd suggest using the function InstanceRunning from unit UniqueInstanceRaw since is a server application.
Title: Re: UniqueInstance 1.0 released
Post by: SunyD on April 22, 2011, 02:44:44 pm
Is it working in terminal services environment?
I have one windows server and 5 users which launch ie. app.exe through RDP protocol (Jestro Cocpit Client - similar to Citrix Client)
When I check server's task manager I see 5 instances of app.exe. But I have one application I would like not to run more than once. I wrote procedure to check unique instances but it doesn't work. It doesn't see other processes, only from my session.

Try this in your main project file:
Code: [Select]

uses windows;

var  MySem  : THandle;
begin
  // check if 1.Start ?
  MySem := CreateSemaphore(nil,0,1,'ThisStringMustBeUnique18454');
   if ((MySem <> 0) and (GetLastError = ERROR_ALREADY_EXISTS)) then begin
     CloseHandle(MySem);
     Halt;   //Close The programm
   end;
 // End of check if 1.Start ?

 // put here your code like
 //......


TinyPortal © 2005-2018