🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Using a window handle

#3644
From: Remy Lebeau (TeamB)
Date: Wed, 10 May 2006 21:50
46 lines
2160 bytes
"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: <446260ad$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!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>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,85bceed53b519705
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: <4461e528@newsgroups.borland.com> <44621e0c$1@newsgroups.borland.com> <446259de@newsgroups.borland.com>
Subject: Re: Using a window handle
Date: Wed, 10 May 2006 14:50:28 -0700
Lines: 48
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: <446260ad$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1147297965 68.69.17.41 (10 May 2006 14:52:45 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail