?
Solved

Some issue of my application

Posted on 1997-08-26
3
Medium Priority
?
170 Views
Last Modified: 2010-04-06
Hi yee,

I've got a problem. I want to build an application which can be running
one instance at one time. A know a solution but it works only when the
application was loaded into the memory. Is there any chance to provide
this, I mean the code must be compiled under some extra circumstances.
For example the operating system, Windows95 can recognise that this
application can be run in one instance at one time.

Any help regarded,

Ciao

Andrew Kabdebon

ethkaan@eth.ericsson.se
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
3 Comments
 
LVL 1

Expert Comment

by:peter_vc
ID: 1342534
By issue I assume you mean instance?  You want to restrict your program so that only one copy can be running.

I also think you want to restrict it so that only one copy will run anywhere on a network at any given time.  Is this correct?

Its difficult to understand the question.  Are you actually writing it for Windows 95?


0
 

Author Comment

by:bandi081497
ID: 1342535
Edited text of question
0
 
LVL 5

Accepted Solution

by:
ronit051397 earned 100 total points
ID: 1342536
try this. write it in the dpr file.
--------------------------------------------------------
var FWindow: THandle;
Begin
  FWindow:=FindWindow('TfMain',write here the caption of the form or nil);//find a window by the class of the form, in this case is TfMain
  if FWindow<>0 then
  begin
    SetForegroundWindow(FWindow);
    ShowWindow(FWindow,SW_SHOW);
    Application.Terminate;
    Exit;
  end;

  Application.Initialize;
  Application.CreateForm(TfMain, fMain);
  Application.Run;
end.
--------------------------------------------------------
this is not an elegant solution but...
0

Featured Post

Industry Leaders: 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

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 my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

764 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