Article View: borland.public.cppbuilder.nativeapi
Article #13036Re: Want to change position of standard dialogs
From: Remy Lebeau (TeamB)
Date: Fri, 31 Oct 2003 03:24
Date: Fri, 31 Oct 2003 03:24
49 lines
2557 bytes
2557 bytes
"Rodolfo Frino" <rodolfowrvxg527u7qfrino@yahoo.com.jki> wrote in message
news:3fa1b607$1@newsgroups.borland.com...
> FindWindow(NULL, DialogTitle ), // handle of window
Better to just use the actual Title:
if( !OpenDialog1->Title.IsEmpty() )
FindWindow(NULL, OpenDialog1->Title.c_str() )
else
FindWindow(NULL, "Open" )
Now, with that said, using the OnShow event is too soon to move the dialog,
and using the OnSelectionChanged event is too late to prevent the dialog
from noticably flickering from one position to another. The following code
works for me in delaying the moving while also hiding the flickering:
#define APPWM_MOVE_OPENDIALOG (WM_APP + 100)
void __fastcall TForm1::Button1Click(TObject *Sender)
{
OpenDialog1->Execute();
}
void __fastcall TForm1::OpenDialog1Show(TObject *Sender)
{
SendMessage(GetDesktopWindow(), WM_SETREDRAW, FALSE, 0);
PostMessage(Handle, APPWM_MOVE_OPENDIALOG, 0, 0);
}
void __fastcall TForm1::WndProc(TMessage &Message)
{
if( Message.Msg == APPWM_MOVE_OPENDIALOG )
{
SetWindowPos(GetParent(OpenDialog1->Handle), NULL,
Message.WParam, Message.LParam, 0, 0, SWP_NOSIZE|SWP_NOZORDER);
SendMessage(GetDesktopWindow(), WM_SETREDRAW, TRUE, 0);
InvalidateRect(NULL, NULL, TRUE);
Message.Result = TRUE;
}
else
TForm::WndProc(Message);
}
Gambit
Technical Details
Message-ID:
<3fa1d558@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> <3fa19d6a@newsgroups.borland.com> <3fa1a188$1@newsgroups.borland.com> <3fa1b607$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-10-30 19:39:13 PST From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3FA01311.62845116@uni-trier.de> <3fa19d6a@newsgroups.borland.com> <3fa1a188$1@newsgroups.borland.com> <3fa1b607$1@newsgroups.borland.com> Subject: Re: Want to change position of standard dialogs Date: Thu, 30 Oct 2003 19:24:54 -0800 Lines: 51 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: 67.22.137.75 Message-ID: <3fa1d558@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1067570520 67.22.137.75 (30 Oct 2003 19:22:00 -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