PlanetSquires Forums

Support Forums => PlanetSquires Software => Topic started by: Bumblebee on November 26, 2021, 04:54:30 PM

Title: Always on top
Post by: Bumblebee on November 26, 2021, 04:54:30 PM
How would I go about creating a window or form that remains always on top?
Title: Re: Always on top
Post by: David Kenny on November 26, 2021, 07:56:16 PM
Take a look at SetWindowPos, the second parameter should be HWND_TOPMOST.
Title: Re: Always on top
Post by: Paul Squires on November 26, 2021, 08:02:06 PM
David beat me to it as I was testing code to post! First time I've coded in WinFBE in a while and I lost out on providing the answer. LOL


''
''
Function frmMain_Load( ByRef sender As wfxForm, ByRef e As EventArgs ) As LRESULT

   SetWindowPos( sender.hWindow, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE )
   
   Function = 0
End Function

Title: Re: Always on top
Post by: David Kenny on November 26, 2021, 08:14:21 PM
Well, since I didn't provide a tested example, your post is more useful.  :)
Title: Re: Always on top
Post by: Bumblebee on November 26, 2021, 11:42:39 PM
Excellent, this does the trick. Thanks again!
Title: Re: Always on top
Post by: Petrus Vorster on December 01, 2021, 12:11:19 PM
Out of pure curiosity, the TOPMOST setting in a SetwindowsPOS, will it keep your form on top no matter what?

I was wondering what happens if you call other programs or forms with that setting, or will it keep the last called one on top?
Just curious if you have more than one of these what happens?

Regards, Peter
Title: Re: Always on top
Post by: Bumblebee on December 02, 2021, 12:15:36 PM
Calling another program where it is set to always be on top, does place it on top.