Solved

Application clones

Posted on 1997-08-14
1
143 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
1 Comment
 
LVL 3

Accepted Solution

by:
mirek071497 earned 50 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi TcxGrid group footer summary 3 213
Print Graphic and Text to Epson TM-T88v 12 188
Dev express lookupcombo 3 14
Graphics32 under Delphi 10.1 Berlin 2 40
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

864 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now