🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Modifying the TOpenDialog or TSaveDialog

#2534
From: Remy Lebeau (TeamB)
Date: Fri, 09 Feb 2007 23:18
30 lines
2002 bytes
"Dan Mayo" <do_not_spam_dmayo2@netzero.com> wrote in message
news:45ccc478$1@newsgroups.borland.com...

> Reading the Help file, it looks like I can get the Handle for the
> TOpenDialog in the OnShow event.

You can.  What the help does not tell you, however, is that you need
to use the Win32 API GetParent() function to get the *corrent* HWND to
use from the dialog's Handle property.

> I was thinking that if I had the handle, then I could create a
button
> and add a button to that dialog

You can.

>     Button->ParentWindow = this->Handle; //I figure this would do
it,
> but it doesn't

That is the wrong Handle to use.  The event handler is a member of
your TForm class, so the 'this' pointer will point to the instance of
your TForm.  Thus, you are using the TForm's HWND as the parent window
instead of the dialog's HWND.  You need to use this instead:

    Button->ParentWindow = ::GetParent(SaveDialog1->Handle);


Gambit
Technical Details
Message-ID: <45cd016e$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!newsfeed.gamma.ru!Gamma.RU!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <45c9f090$1@newsgroups.borland.com> <45caed68@newsgroups.borland.com> <45cca151$1@newsgroups.borland.com> <45ccc478$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,991e7cc92168a8f1
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: <45c9f090$1@newsgroups.borland.com> <45caed68@newsgroups.borland.com> <45cca151$1@newsgroups.borland.com> <45ccc478$1@newsgroups.borland.com>
Subject: Re: Modifying the TOpenDialog or TSaveDialog
Date: Fri, 9 Feb 2007 15:18:28 -0800
Lines: 32
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: 75.83.34.171
Message-ID: <45cd016e$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1171063150 75.83.34.171 (9 Feb 2007 15:19:10 -0800)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!newsfeed.gamma.ru!Gamma.RU!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail