Article View: borland.public.cppbuilder.nativeapi
Article #5453How to make a window at *runtime* topmost via:-SetWindowPos() & UpdateWindow()
From: Oren Halvani
Date: Wed, 17 Aug 2005 13:24
Date: Wed, 17 Aug 2005 13:24
39 lines
2073 bytes
2073 bytes
dear builders,
i'm trying to make a window topmost in runtime..i know some people here
suggested me to avoid it, but i have to...
i'm using: SetWindowPos(..) to set it as topmost - what works fine..
but the window is not recreated..so i using UpdateWindow(handle..)
but it still does not recreate...i already tryed: ShowWindow() and
BringToFront()
but --NOTHING-- seems to force the window to be recreated...
what else do i need...?
Oren
/*********************************************************/
void __fastcall TfrmOptions::chkForegroundClick(TObject *Sender)
{
if(chkForeground->Checked)
{
imgAlways_OnTop1->Visible = true;
imgAlways_OnTop2->Visible = false;
SetWindowPos(Handle, HWND_TOPMOST, Left, Top, Width,
Height,SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
UpdateWindow(frmOptions->Handle);
}
else
{
imgAlways_OnTop1->Visible = false;
imgAlways_OnTop2->Visible = true;
SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE |
SWP_NOSIZE);
UpdateWindow(frmOptions->Handle);
}
}
Technical Details
Message-ID:
<43033a7e$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newsread.com!news-xfer.newsread.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,175ffbbcf7a4552c,start X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit Reply-To: "Oren Halvani" <NoSpam@fdtd.com> From: "Oren Halvani" <NoSpam@fdtd.com> Newsgroups: borland.public.cppbuilder.nativeapi Subject: How to make a window at *runtime* topmost via:-SetWindowPos() & UpdateWindow() Date: Wed, 17 Aug 2005 15:24:23 +0200 Lines: 41 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 84.176.71.7 Message-ID: <43033a7e$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1124285054 84.176.71.7 (17 Aug 2005 06:24:14 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newsread.com!news-xfer.newsread.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail