[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 175
  • Last Modified:

Some issue of my application

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
bandi081497
Asked:
bandi081497
1 Solution
 
peter_vcCommented:
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
 
bandi081497Author Commented:
Edited text of question
0
 
ronit051397Commented:
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now