🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Avoiding multiple programinstances and restore the firstone

#6675
From: Bob Gonder
Date: Fri, 22 Apr 2005 14:58
15 lines
1707 bytes
Hans Galema wrote:

>           if ( OldTitle == AnsiString ( titlebuffer ) )
>              {
>              ShowMessage ( "this is not the first instance ("
>                  + AnsiString ( titlebuffer )
>                  + ") you will get the first one." );
>
>              ::SendMessage( hwnd, WM_SYSCOMMAND, SC_RESTORE, 0);

Might want to make that a PostMessage, or at least SendMessageTimeout
What happens here if the original app is closing, or is closed while
ShowMessage is up?

>              ::SetForegroundWindow( hwnd );
Technical Details
Message-ID: <724i61hsr1dtvg6nhaoksbhpevbcvh4ei4@4ax.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newshosting.com!nx02.iad01.newshosting.com!diablo.voicenet.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <4268dde6$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,fd5c6cb9a40ec609
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: Bob Gonder <notbg@notmindspring.invalid>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Avoiding multiple programinstances and restore the firstone
Date: Fri, 22 Apr 2005 07:58:03 -0700
Organization: MindSpring Enterprises, Inc.
Reply-To: notbg@notmindspring.invalid
Message-ID: <724i61hsr1dtvg6nhaoksbhpevbcvh4ei4@4ax.com>
References: <4268dde6$1@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 67.77.154.2
X-Trace: newsgroups.borland.com 1114181880 67.77.154.2 (22 Apr 2005 07:58:00 -0700)
Lines: 16
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newshosting.com!nx02.iad01.newshosting.com!diablo.voicenet.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail