1. Computing

Controlling the number of application instances

From Zarko Gajic, About.com GuideOctober 12, 2006

Follow me on:

Advanced Delphi :: In this article you'll learn how to "run-once enable" a Delphi application that can check for its previous (running) instance. Along the process, several techniques of implementing such a check will be discussed; as well as how to bring your already running application to the foreground, if a user tries to run it "one more time". By the end of the article you'll have a copy-to-go code to control the behavior of your application's multiple instances: with the option to limit the number of running instances.

Related: TInstance Control | Using WMCopyData to communicate between applications | Creating a Splash Screen

Comments
October 22, 2006 at 11:46 am
(1) UFOProjects says:


if (Mutex = 0) OR (GetLastError = ERROR_ALREADY_EXISTS) then
begin
SendMessage(HWND_BROADCAST, MyMsg, 0,0);
end

there should be PostMessage instead of SendMessage:p

Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>
Top Related Searches application instances

©2013 About.com. All rights reserved.