🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #6583

Re: Activating the first instance of a program when it's started multiple times

#6583
From: Remy Lebeau (TeamB)
Date: Fri, 22 Apr 2005 19:00
22 lines
1930 bytes
"Hans Galema" <notused@notused.nl> wrote in message
news:42693703$1@newsgroups.borland.com...

> But there is still a problem then. The second instance has the same
> ClassName(). So how would you distinghuish between the first and
> the last ?

If you look for a form rather than the TApplication window, then you can
call FindWindow() before the second instance ever created any forms
instances.  Thus only the first instance's forms will be available to be
found.

> When searching for an Application->Title the trick was to
> temporally give the Application no Title. How for a ClassName() ?

The class name of TApplication will always be "TApplication" for any VCL
project.  So you don't look for TApplication to begin with.  Look for TForm
instance instances instead, since their names can be unique per project.


Gambit
Technical Details
Message-ID: <4269495c$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <42688891@newsgroups.borland.com> <1mg2vb4nfnxtd.1d6dylzi167fk.dlg@40tude.net> <4268b171@newsgroups.borland.com> <4268bba1@newsgroups.borland.com> <4268c454@newsgroups.borland.com> <42692f91$1@newsgroups.borland.com> <42693703$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,3c4287e4044a862e
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <42688891@newsgroups.borland.com> <1mg2vb4nfnxtd.1d6dylzi167fk.dlg@40tude.net> <4268b171@newsgroups.borland.com> <4268bba1@newsgroups.borland.com> <4268c454@newsgroups.borland.com> <42692f91$1@newsgroups.borland.com> <42693703$1@newsgroups.borland.com>
Subject: Re: Activating the first instance of a program when it's started multiple times
Date: Fri, 22 Apr 2005 12:00:52 -0700
Lines: 24
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.69.17.41
Message-ID: <4269495c$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1114196316 68.69.17.41 (22 Apr 2005 11:58:36 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail