News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Program loses HWND_TOPMOST status

Started by jj2007, September 08, 2022, 08:17:18 PM

Previous topic - Next topic

jj2007

I have a program with HWND_TOPMOST status. After several hours, it suddenly loses that status. Has that ever happened to you?

Biterider

Hi JJ
No, I've never experienced anything like this.

Biterider

hutch--

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.

jj2007

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.

tenkey

I've always wondered what happens when two windows get topmost status.

hutch--

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.

NoCforMe

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:
Assembly language programming should be fun. That's why I do it.

jj2007

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:

NoCforMe

So maybe it's something else other than where it's launched from ...
Assembly language programming should be fun. That's why I do it.

mikeburr

jj .. overwriting something ?? eg subscript error etc ??
regards mike b

jj2007

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*.

hutch--

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.