Solved

Dupelicate Instantces

Posted on 2000-04-05
10
143 Views
Last Modified: 2010-04-04
How do I check my program for duplicate instantaces??? Thanks!
0
Comment
Question by:nafa2221
10 Comments
 
LVL 13

Accepted Solution

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

 
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

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 10 Seattle Dataset Actions 5 79
TVirtualStringTree  search using TEdit 7 106
Machine not responding during CopyFile() 3 89
Intraweb download file link ? 1 109
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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

910 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