Lazarus
Announcements => Third party => Topic started 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
-
Cool.. :)
I love it.. :D
I hope it will works in my projects. Amen.
Thank you for your times to built this component, Sir.
-
Thank you, well done!
-
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.
-
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.
-
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:
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
//......