🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: How to bring window (TForm) front

#1329
From: << Wiljo >>
Date: Tue, 18 Sep 2007 11:32
30 lines
2035 bytes
Vladimir Stefanovic schreef:
>>         if ( IsIconic( hAppWnd ) )
>>         {
>>            ShowWindow( hAppWnd, SW_RESTORE );
>>         }
>>         SetForegroundWindow( hAppWnd );
> 
> I hope this works ;)
> (saved in my archives anyway, and will test once in real
> working software)
> 
> But I think that there was some reason why I moved
> bring-to-front code to local app side.
> 
We had the same problem here as well. And we were finally using the 
Minimize and Restore option described in the original post as well. Not 
really nice, but it did the job. I have just tried this new approach, 
and I must say that it works like a charm. Never thought the Application 
itself was a window, albeit hidden from view. We use it on the local 
application side that is being restoredas well. It gets an IPC message 
anyway, so we can now write:

     if( IsIconic( Application->Handle ))
     {
         ShowWindow( Application->Handle, SW_RESTORE );
     }
     SetForegroundWindow( Application->Handle );

Many thanks for this simple solution.
Wiljo.
Technical Details
Message-ID: <46efb73e$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <46eecb19@newsgroups.borland.com> <46eed78e@newsgroups.borland.com> <46eedad2@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,67bd98c5f67e7407
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Tue, 18 Sep 2007 13:32:16 +0200
From: "<< Wiljo >>" <wherever@theuniverse.com>
User-Agent: Thunderbird 2.0.0.6 (Windows/20070728)
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: How to bring window (TForm) front
References: <46eecb19@newsgroups.borland.com> <46eed78e@newsgroups.borland.com> <46eedad2@newsgroups.borland.com>
In-Reply-To: <46eedad2@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 81.207.96.249
Message-ID: <46efb73e$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1190115134 81.207.96.249 (18 Sep 2007 04:32:14 -0700)
Lines: 30
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail