Solved

Application clones

Posted on 1997-08-14
1
146 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 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Multiple image collision 13 106
How to define IfThen functions in one common unit? 4 78
DBCtrlGrid, Delphi, Scroll 8 86
SQL Server Express automatically execute SQL or SP 8 64
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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

734 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