🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Using a window handle

#3650
From: Malcolm Smith
Date: Thu, 11 May 2006 11:27
69 lines
2961 bytes
Remy,

It turned out to be incorrect behaviour - my form become embedded in the 
cleanup manager (as described in the help file).

Is there any way I can make the cleanup manager auto minimize/restore if a 
user minimizes my form ?

If not, I'll just have to remove the minimize button and be done with it.

-- 
Malcolm Smith
MJ Freelancing
http://www.mjfreelancing.com

Associate Editor
C++Builder Developers Journal
http://www.bcbjournal.com

"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message 
news:446260ad$1@newsgroups.borland.com...
>
> "Malcolm Smith" <mjfreelancing@optusnet.com.au> wrote in message
> news:446259de@newsgroups.borland.com...
>
>> The HWND is coming into my DLL from the Cleanup Manager, not going out.
>
> Exactly.  You have to use the HWND that is passed into ShowProperties() as
> the parent window for any windows that ShowProperties() displays.
>
>> we are caching the form in case the user shows it more than once
>
> You need to change the form's ParentWindow property, ie:
>
>    HRESULT STDMETHODCALLTYPE TDevCleanCtrlImpl::ShowProperties(HWND hwnd)
>    {
>        try
>        {
>            if( !frmFileDetails )
>                frmFileDetails = new TfrmFileDetails( NULL, FVolume,
> FFileSearch, FFileStates );
>        }
>        catch(const Exception &)
>        {
>            return E_OUTOFMEMORY;
>        }
>
>        try
>        {
>            frmFileDetails->ParentWindow = hwnd;
>            try {
>                frmFileDetails->ShowModal();
>            }
>            __finally {
>                frmFileDetails->ParentWindow = NULL;
>            }
>        }
>        catch(const Exception &)
>        {
>            return E_UNEXPECTED;
>        }
>
>        return S_OK;
>    }
>
>
> Gambit
>
> 
Technical Details
Message-ID: <44631fb8$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!newsfeed.gamma.ru!Gamma.RU!ecngs!feeder.ecngs.de!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4461e528@newsgroups.borland.com> <44621e0c$1@newsgroups.borland.com> <446259de@newsgroups.borland.com> <446260ad$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,85bceed53b519705
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
Reply-To: "Malcolm Smith" <mjfreelancing@optusnet.com.au>
From: "Malcolm Smith" <mjfreelancing@optusnet.com.au>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <4461e528@newsgroups.borland.com> <44621e0c$1@newsgroups.borland.com> <446259de@newsgroups.borland.com> <446260ad$1@newsgroups.borland.com>
Subject: Re: Using a window handle
Date: Thu, 11 May 2006 21:27:49 +1000
Lines: 71
Organization: MJ Freelancing
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 211.30.161.48
Message-ID: <44631fb8$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1147346872 211.30.161.48 (11 May 2006 04:27:52 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!newsfeed.gamma.ru!Gamma.RU!ecngs!feeder.ecngs.de!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail