Article View: borland.public.cppbuilder.nativeapi
Article #12967Re: Want to change position of standard dialogs
From: Rodolfo Frino
Date: Sat, 01 Nov 2003 15:06
Date: Sat, 01 Nov 2003 15:06
65 lines
2859 bytes
2859 bytes
> Here's a page that simply answers your question:
> http://thunder.prohosting.com/~cbdn/cd002.htm
That won't work. Can I suggest the following modification to the code
shown on the above link:
#include <vcl.h>
#pragma hdrstop
#include "MoveWindow.h"
//--------------------------------------------------------------------------
-
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
TOpenDialog* OpenDialog1;
String DlgTitle;
//--------------------------------------------------------------------------
-
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
//CREATE OPENDIALOG --------------------------------------------
OpenDialog1 = new TOpenDialog(this);
OpenDialog1->Title = "Title";
DlgTitle = OpenDialog1->Title;
OpenDialog1->OnShow = OpenDialog1Show;
}
//--------------------------------------------------------------------------
-
void __fastcall TForm1::BitBtn1Click(TObject *Sender)
{
OpenDialog1->FileName = "doc.c";
if (OpenDialog1->Execute())
{
// Place your code here
}
}
//--------------------------------------------------------------------------
-
void __fastcall TForm1::OpenDialog1Show(TObject *Sender)
{
TRect rect;
HWND H = GetParent(dynamic_cast<TOpenDialog*>(Sender)->Handle);
GetWindowRect(H, &rect);
MoveWindow(H,
0, // put your coordinate here as required
0, // put your coordinate here as required
rect.right - rect.left,
rect.bottom - rect.top,
true);
Abort();
}
Ah, by the way a short message for Remy: here there is no flickering
and also this is the simplest solution :-)
Rodolfo
Technical Details
Message-ID:
<3fa3cbc9@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3FA01311.62845116@uni-trier.de> <3fa01ca8$1@newsgroups.borland.com> <3FA17CBA.B471BFE8@uni-trier.de> <3fa29ce3$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,5023092a61a6c0b9 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-11-01 07:09:12 PST From: "Rodolfo Frino" <rodolfowrvxg527u7qfrino@yahoo.com.jki> Newsgroups: borland.public.cppbuilder.nativeapi References: <3FA01311.62845116@uni-trier.de> <3fa01ca8$1@newsgroups.borland.com> <3FA17CBA.B471BFE8@uni-trier.de> <3fa29ce3$1@newsgroups.borland.com> Subject: Re: Want to change position of standard dialogs Date: Sun, 2 Nov 2003 02:06:11 +1100 Lines: 67 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 203.206.20.185 Message-ID: <3fa3cbc9@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1067699145 203.206.20.185 (1 Nov 2003 07:05:45 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail