Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Dupelicate Instantces

Posted on 2000-04-05
10
Medium Priority
?
152 Views
Last Modified: 2010-04-04
How do I check my program for duplicate instantaces??? Thanks!
0
Comment
Question by:nafa2221
[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
10 Comments
 
LVL 13

Accepted Solution

by:
Epsylon earned 200 total points
ID: 2688152
On this page you can see how to do that:

http://www.gnomehome.demon.nl/uddf/pages/api.htm#api0
0
 

Author Comment

by:nafa2221
ID: 2688676
that was somewhat confusing, can u post an example and where I would post the code, also can u tell me howto get to the area I am supposed to post my code? Thanks!!!
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 2688770
hi nafa2221,

a simple method
(modification in the dpr-file)

program itTimer;

uses
  windows,
  Forms,
  Dialogs,
  itGlobal in 'itGlobal.pas',
  ufrmTIMER in 'ufrmTIMER.pas' {frmTIMER},
  doitAPI in 'doitAPI.pas',
  ufrmTIMERUpdate in 'ufrmTIMERUpdate.pas' {frmTimerUpdate},
  ufrmTIMERShow in 'ufrmTIMERShow.pas' {frmTimerShow},
  ufrmTimerSub in 'ufrmTimerSub.pas' {frmTimerSub},
  ufrmErrorReport in 'ufrmErrorReport.pas' {frmErrorReport},
  ufrmprobtimer in 'ufrmprobtimer.pas' {frmProblemeTimer};

{$R *.RES}

var StartUpH : THandle;

begin
  StartUpH := FindWindow(PChar('TfrmTIMER'),PChar('inTIME · Timer'));
  if (StartUpH <> 0) and (ParamStr(1) <> 'Test') then  //no testenviroment
  begin
//    ShowWindow(StartUpH,SW_SHOW);
    MessageDlg('itTimer ist bereits gestartet!',mtInformation,[mbOK],-1);
  end
  else
  begin
    Application.Initialize;
    Application.Title := 'inTIME · Timer';
    Application.CreateForm(TfrmTIMER, frmTIMER);
  Application.CreateForm(TfrmTimerUpdate, frmTimerUpdate);
  Application.Run;
  end;
end.

meikl
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 1

Expert Comment

by:fulvio_brasil
ID: 2688776
Try this (put the code in .DPR file)

var Handle1: HWND;

begin
  Application.Initialize;
  Handle1 := FindWindow('TfrmMain','Caption');
  if (Handle1 = 0) then begin
    Application.CreateForm(TfrmMain, frmMain);
    ...
    Application.Run;
  end
  else
    ShowMessage('App already running!');
end.

Obs: 'TfrmMain' = Class of Main Form
     'Caption' = Caption on Main Form

cheers,

Fulvio.
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 2688788
Fulvio, would you mind to withdraw your answer since other solutions have been given before you...?
0
 
LVL 1

Expert Comment

by:fulvio_brasil
ID: 2690289
No problem Epsylon!

What happend was when I posted it I didn't see the other solution (just 3 min. before)

See you,

F.
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 2690340
Yup, I see   :o)
0
 
LVL 1

Expert Comment

by:fulvio_brasil
ID: 2692099
Hi Epsylon, please, could you answer me why a lot of people offers the answer like a comment, what's the advantage?
And about the point? How they won the points?

I'm new in the site and never understood it :o)

Thanks in advance,

Fulvio.
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 2697569
Fulvio, when you're sure that the answer is correct AND your're the first one then you could submit it as answer. But when someone else has already given a (partial) solution, submit it as comment. This is an unwritten(?) rule here at EE...
0
 
LVL 1

Expert Comment

by:fulvio_brasil
ID: 2698956
Thanks Epsylon! :o)
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
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

670 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