I have a VB application, notably
Freebar, which has a setting to keep it "always on top". The code for this setting is as follows:
SetWindowPos Me.hWnd, IIf(GetValueFromINI(SETTINGS_INI_SECTION, "OnTop", SettingsINI, DEFAULT_ONTOP) = "1", HWND_TOPMOST, HWND_NOTOPMOST), 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE
The setting seems to work for the most part. However, it stops working periodically throughout the day - specifically, when I receive an incoming call on Apropos (I HATE that program).
So my question is - why doesn't Freebar stay on top? Apropos is NOT configured to be "always on top", but it does steal focus when a call comes in (even with TweakUI installed and registry tweaked). I'm wondering if one application is "topmost" and another application comes along and sets itself as "topmost", what happens to the first application? My theory is that the Apropos developers used the topmost option as a way to steal focus while circumventing Windows' settings. I have tested with Windows Task Manager set to "always on top" and when Apropos rings, task manager loses its topmost position.
Does anybody have any ideas on how I could work around this? I can modify the source code for Freebar if there's a change I can make that will get it to stay always on top.