|
I've actually created such an application!
It was WinForms and VB.NET I think, probably .NET 4.5 or something.
I may have used that attribute you mention, but I remember it not always working.
For my application is was absolutely necessary that it worked.
First off, this was an application for factory workers using a touch screen (no physical mouse or keyboard).
The app opened full screen and the only way to close it was by closing it with a button (not the default Windows buttons, because I disabled those).
The thing is, they needed an on-screen keyboard.
The Windows on-screen keyboard was too small and had to many options for these simple workers (who would no doubt use it to mess things up), so I rolled out my own.
Since I created a sort of "factory application" framework, which we were going to use for multiple forms and applications for different customers, it all had to be quite generic, as to be reusable.
And "make sure you design your forms so a keyboard could popup at any time" isn't very generic, so the keyboard had to float above all else.
If the keyboard disappeared for whatever reason, you got stuck because there was no way to input anything.
So I made it always on top (not the application, I think, but that specific form).
Things even worked in design-time.
Colleagues could add buttons and "widgets" to a form similar as to how you add columns to a DataGridView.
They'd all look the same and every form had a similar look and feel, even though it was all custom software with very different functionalities.
Probably one of the hardest things I've ever programmed.
After some hacks to get the keyboard always on top it worked wonderfully well.
They're still using it now, 10 years later.
It was fun to make too.
I could spend my free time on it and I got paid double hours.
That way, they kept development in-house and I could still work on my regular projects, while having fun with this and making extra money.
I even worked on it during Christmas.
A new manager called me in after Christmas and started asking about my relation with my parents.
I was like "It's good... Where are you going with this?"
"I see you worked during Christmas."
"Yeah, I spent half a day with family and after that I was just having fun and making money! "
Ah, good old times.
|
|
|
|
|
The cynic in me would just reply "cool story, bro", but that was, in fact, a cool story.
I know exactly how to do it, but the mystery in this case is how on God's Green Earth are random application windows getting that attribute when they don't (shouldn't?) even have code to do so. Like bits are flipping around randomly for no reason. Only, once it gets set, it never gets removed - unless I restart the app...
|
|
|
|
|
After I wrote all that even I was like TL;DR
dandy72 wrote: I know exactly how to do it, but the mystery in this case is how on God's Green Earth are random application windows getting that attribute when they don't (shouldn't?) even have code to do so. Like bits are flipping around randomly for no reason. Only, once it gets set, it never gets removed - unless I restart the app...
if (!alwaysOnTopSet)
{
_alwaysOnTopSet = Random.Next(10) == 0;
} I thought you knew exactly how to do this
|
|
|
|
|
Smartass. Have a 5!
|
|
|
|
|
There's been a big change in how UIs behave which is that previously the user had control and would not be interrupted by the OS, processes or notifications - the user always had focus.
Nowadays, the user is just seen as one process and that process can be interrupted, have notifications pop up over a cursor or mouse pointer and be interrupted at any time - the user has become the slave to the machine.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
Well that's arguably a good thing, since Windows is a multi-user OS. Even though you could also argue that since every user has his own desktop, he should still own it and other users running their own things at the same time should not have any influence on what gets shown on each user's screen...
|
|
|
|
|
GuyThiebaut wrote: the user had control and would not be interrupted by the OS, processes or notifications I have been using tools that frequently created error reporting dialog windows consistently at the bottom of the window stack - it could even be obscured by its own main window! The dialogs were modal, blocking the application from execution, until by accident or luck moved other windows to discover that there was a new window down at the bottom demanding my attention and action.
It really was a pain in the lower part of the back. I hated it. If an application requires me to take an action for it to continue, it should call my attention to it, one way or the other. Equally bad is if the notification or error dialog pops up a large, centered window, immediately grabbing keyboard, mouse and other inputs in the middle of a word that I am typing, or the dragging of an object. There is a middle ground, e.g. a flashing icon in the taskbar. But I prefer a dialog on top that does not grab focus (and preferably not centered) to a window at the bottom of the window stack.
The ideal would be an option to put the window as the second one from the top, so that it won't obscure the one currently having focus, with the default/automatic placement algorithm ensuring that a significant part of it sticks out from under the currently active window.
|
|
|
|
|
Here is an AutoHotKey script to toggle topmost. It may be able to disable the feature for you if you use AHK:
; possibly from http:
!`:: ;Alt `
WinGet, currentWindow, ID, A
WinGet, ExStyle, ExStyle, ahk_id %currentWindow%
if (ExStyle & 0x8) { ; 0x8 is WS_EX_TOPMOST.
Winset, AlwaysOnTop, off, ahk_id %currentWindow%
SplashImage,, x0 y0 b fs12, OFF always on top.
Sleep, 1500
SplashImage, Off
}
else {
WinSet, AlwaysOnTop, on, ahk_id %currentWindow%
SplashImage,,x0 y0 b fs12, ON always on top.
Sleep, 1500
SplashImage, Off
}
return
|
|
|
|
|
I can't say I've seen any apps that force the always on top lately, with the possible exception of some splash screens on opening. I'm thinking I've seen that with a couple opening from "show hidden icons" menu on the task bar. But they don't maintain it once they load.
Some errant App code could set it or something wonky in a focus/modal call in an older program? Back in the day I used "always on top" a couple of times, but it usually turned out to be a nightmare. It's like setting the "unintended consequences" attribute
|
|
|
|
|
In a couple little utility apps I've made, I have a menu selection for this. When I do offer that option, I also offer one to make the window transparent when not top in the z-order, and a transparency percent. So even though it could be stay on top, you can still see thru it. It has it's uses.
|
|
|
|
|
I have a feeling this is not a bug in the topmost window handling in the application, but in Windows' management of which application it decides is the foreground app. There have been numerous changes to the foreground decision logic during Windows 7, 10, and 11. Some of the changes were hailed by Microsoft that they gave the user more control, and disallowed applications from the annoying tendency of grabbing the foreground. I also have the feeling some of these changes have been 'internal' in order to handle task bar notification balloons and such. There are also problems with legacy API's (for example, some message box options) that assume foreground behaviors that are no longer certain.
TL;DR - It's complicated, from some perspectives it's broke, and they ain't gonna fix it.
Software Zen: delete this;
|
|
|
|
|
This is the closest thing to a possible explanation as I've seen throughout this entire thread; seems like some people have missed my point, or intentionally ignored it.
Gary Wheeler wrote: TL;DR - It's complicated, from some perspectives it's broke, and they ain't gonna fix it.
No feature is ever so simple that MS can't find a way to complicate it to the point where it becomes buggy.
|
|
|
|
|
Windows PowerToys has a feature to toggle any app to become top-most. It would be cool for that feature to notify you which apps are already top-most, and flip that switch off if they try to force being top-most.
|
|
|
|
|
That's an intriguing idea.
If it was such a big hassle, I just might throw something together to periodically pool all windows and look which has the attribute, and log when the topmost flag gets assigned to a window - that might help narrow down what actually triggers it.
But, it's still so rare I don't think I'd invest the time in doing that. Every time I've seen this happen, closing/restarting the app is all that's needed to get the window behaving normally again, and I can certainly live with that.
|
|
|
|
|
POWER TOOLS 💪 POWER, FLEX
came to say same.
And Media Player Classic has 3 options, for all the uhm "home movies" I watch. 😶
always on top
on top while playing 👍
off
|
|
|
|
|
No, I have not seen windows forcibly moved underneath an "always on top" window, but I have often waited for some function in an app to be done with a spinning GIF indicating that it is working on the task, then several minutes later, maybe after I have given up and aborted the operation, find that there was a required dialog to continue that process underneath the main window that I was waiting on. That's one case where such dialogs should be "always on top", so I don't miss them.
|
|
|
|
|
MessageBox.Show( "blah" );
...with no parent param specified will often result in that sort of thing. If you've switched to another app before the popup appears, giving focus back to the app will NOT bring the popup back from behind whatever it's hiding.
Set your message box parents, people!!
|
|
|
|
|
I've recently started using "EPG Centre", an app that reads the EPG that's broadcast by Freeview. Its progress bar is always on top. It takes several minutes to read the EPG, so I start it and then let it run in the background, but the progress bar stays on top, for no reason.
|
|
|
|
|
Sounds like in this case, it was intentionally designed this way. Clearly these guys think they're so important the progress bar must always remain visible...
|
|
|
|
|
|
Managed code or unmanaged code? Could a memory leak or uninitialized pointer flip the always on top setting for a long running app? Even managed code can be leaky, but usually you just run out of memory.
|
|
|
|
|
So I got my new laptop yesterday and it has Windows 11 installed.
First of all, I tried to sign in with my business email, as it's a business laptop.
Impossible.
This isn't something that's a problem with Windows 11, but with Microsoft in general.
Microsoft accounts are a mess, like a huge stinking pile of manure.
So I'm logged in with my personal account (I wonder how I'd do this for employees in the future) and I upgraded to Windows 11 Pro on my personal account.
That Microsoft, the company for businesses, doesn't allow business accounts to log in is beyond me though.
Now, I haven't actually used it yet (still downloading and installing all my stuff), but I already hate the new taskbar.
I don't even mind that it's centered, but the only option for your applications is an icon with multiple instances of the same app grouped together.
You can't see how many instances of Visual Studio are open and you need to hover first to select the one you want.
That's an additional action each time I need to open or switch an app.
This has been around for a long time, but you could always override this in settings to ungroup and show names too.
No more overriding in Windows 11, this is it now.
The start menu got a makeover too.
Where I could group applications and even name those groups in Windows 10 (it did that really well!) it's down to just a list in Windows 11.
I have about 35 apps pinned and grouped in Windows 10, the kind I use regularly, but not daily, easily accessible from my start menu.
Well, goodbye to easy access.
Oh yeah, I do get a whole bar of "recommended" apps that I don't want and I can make it a little smaller, but not remove it.
The next issue I found, which is small, but so easy to do better, is your user folder.
It's simply the first five letters of your name, so I'm "sande" now.
No way to change this without going into regedit and hoping nothing will break (haven't changed it (yet)).
Is this the 80's where we had to resort to cryptic naming to save some bytes?
This is the thing I'm doing with Windows, logging in and opening and switching applications, and they've messed it up.
I wonder what more I'll find, but I'm not convinced it will be for the better.
Why!? Probably because it looks just a little bit more sleek.
It's been form over function for many applications for years
At least responses and performance seem to be great, but that's always been true for every freshly installed computer.
If I didn't really need Windows for work I might've switched to Linux at this point
(For those who're going to say Visual Studio etc. now work on Linux, I need to maintain some old WinForms and Crystal Reports applications )
|
|
|
|
|
The user name problem has been around for years, I've fixed in win10 and win7.
A quick search shows it can still be changed. For example this is the first link, haven't tried it nor read it in detail, but it looked similar to the win10 solution
How to Change User Name and Account Name in Windows 11? - Windows 11 Community[^]
The taskbar I believe you can fix.
The new start menu is probably the main reason I haven't upgraded. I think I'll wait until win12 (I've always skipped a version windows anyway).
// TODO: Insert something here Top ten reasons why I'm lazy
1.
|
|
|
|
|
yacCarsten wrote: A quick search shows it can still be changed. Yeah, when you really know what you're doing and fancy going into the registry.
And it might break applications (as is always the case when you go snooping around in the registry), according to another link I've found.
This has never been a problem for me on Windows 10
yacCarsten wrote: The taskbar I believe you can fix. I've googled, but same thing.
Only when you want to make changes in the registry, and according to some sites not even that works anymore.
|
|
|
|
|
Sander Rossel wrote: yacCarsten wrote:The taskbar I believe you can fix.I've googled, but same thing.
Only when you want to make changes in the registry, and according to some sites not even that works anymore.
You can move the Taskbar to the left (or centre) without risking the Registry ...
Settings > Personalisation > Taskbar > Taskbar alignment > Left
As for the username truncating to 5 chars, this also happened on Windows 10. I only have 4 letters in my surname so, on W10 and W11, Windows pads it out to 5 chars by adding a '0'
|
|
|
|
|