I have a program with HWND_TOPMOST status. After several hours, it suddenly loses that status. Has that ever happened to you?
Hi JJ
No, I've never experienced anything like this.
Biterider
JJ,
Just a rough guess but see if SetWindowPos() is being overwritten or changed by some form of code restart. I never run that setting for very long so I have never seen the problem. Another option is to restart the app to ensure the setting remains.
Mystery solved:
- NO, the program doesn't lose the topmost status.
- When I build it, it has the topmost status and keeps it forever.
- However, when I launch it via the Win7 taskbar, it does not get the topmost status, despite the SetWindowPos*.
Does it make sense? NO.
Is it a feature? Certainly, according to Micros*t.
I've always wondered what happens when two windows get topmost status.
JJ,
If the window has been mimimised, when it is restored by clicking on the task bar, set the option in SetWindowPos again.
tenkey,
From memory, the last topmost window has precedence over earlier topmost ones.
Quote from: jj2007 on September 09, 2022, 02:59:13 AM
- However, when I launch it via the Win7 taskbar, it does not get the topmost status, despite the SetWindowPos*.
The taskbar is for losers. :undecided:
Quote from: hutch-- on September 09, 2022, 10:54:27 AMIf the window has been mimimised, when it is restored by clicking on the task bar, set the option in SetWindowPos again.
SetWindowPos has no effect if it was launched from the taskbar (but it works fine when launched from Explorer).
Now that is weird, right? Even weirder: I do have programs that work fine with topmost status launched from the taskbar :badgrin:
So maybe it's something else other than where it's launched from ...
jj .. overwriting something ?? eg subscript error etc ??
regards mike b
Quote from: jj2007 on September 09, 2022, 02:59:13 AM
- When I build it, it has the topmost status and keeps it forever.
- However, when I launch it via the Win7 taskbar, it does not get the topmost status, despite the SetWindowPos*.
I just tested the small memstat app which is set to always on top and you can minimise it to the task bar then restore it and it keeps its always on top status after being minimised and restored multiple times. This is on current Win10 64.