🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: How to make a window at *runtime* topmost via:-SetWindowPos() & UpdateWindow()

#5472
From: Oren Halvani
Date: Thu, 18 Aug 2005 18:16
23 lines
1814 bytes
thanks Remy,

well i forgot to say something:
the Foreground-CheckBox is on a another form, NOT
the main form, so i've added...


void __fastcall TfrmOptions::chkForegroundClick(TObject *Sender)
{
    bool bForeground = chkForeground->Checked;

    imgAlways_OnTop1->Visible = bForeground;
    imgAlways_OnTop2->Visible = !bForeground;

    SetWindowPos(frmMainUnit->Handle, (bForeground) ? HWND_TOPMOST : HWND_NOTOPMOST,0, 0, 0,  0, SWP_NOMOVE | SWP_NOSIZE);
    /*...THIS */ SetWindowPos(frmOptions->Handle, (bForeground) ? HWND_TOPMOST : HWND_NOTOPMOST,0, 0, 0,  0, SWP_NOMOVE | SWP_NOSIZE);
}

is this OK..? i mean it looks fine while i'm testing it, but
just wanted to know if it's safe..


Oren
Technical Details
Message-ID: <4304d052@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <43033a7e$1@newsgroups.borland.com> <430382c4$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,175ffbbcf7a4552c
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Thu, 18 Aug 2005 20:16:01 +0200
From: Oren Halvani <xx@xx.com>
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
X-Accept-Language: de-DE, de, en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: How to make a window at *runtime* topmost via:-SetWindowPos()
 & UpdateWindow()
References: <43033a7e$1@newsgroups.borland.com> <430382c4$1@newsgroups.borland.com>
In-Reply-To: <430382c4$1@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 84.176.56.123
Message-ID: <4304d052@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1124388946 84.176.56.123 (18 Aug 2005 11:15:46 -0700)
Lines: 23
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail