?
Solved

Application clones

Posted on 1997-08-14
1
Medium Priority
?
148 Views
Last Modified: 2010-04-06
Hi yee,

Can anybody tell me, how can I build such an application
under Delphi3 development environment, that my application can be started only once.

Thanks in advance

Andrew Kabdebon
0
Comment
Question by:bandi081497
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 3

Accepted Solution

by:
mirek071497 earned 200 total points
ID: 1341400
You can do this with FileMapping.

It is example :

procedure TForm1.FormCreate(Sender: TObject);
var hMapping : THandle;
begin
  hMapping := $FFFFFFFF;
  hMapping := CreateFileMapping( hMapping, nil, PAGE_READONLY, 0, 32, 'MyTestMap' );
  if( hMapping<>0 ) then
  begin
      if( GetLastError=ERROR_ALREADY_EXISTS ) then
      begin
        ShowMessage( 'Application is running' );
        ExitProcess(1);
      end
   end
   else
     begin
       ShowMessage( 'Error creating mapping' );
       ExitProcess(1);
      end;
end;

p.s. what we can do with you'r second question with the same name ?
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month14 days, 12 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question