Search code examples
c++windowsqtwinapiqt6

How to pin my window to the desktop (like rainmeter) and prevent minimizing by "Show Desktop"/win+d in qt/c++


Does anybody know how to make a 'always-on-bottom" window without it minimizing to win+d, or a window pinned to the desktop? qt and c++ solutions would be great.

I tried using a few things such as: SetWindowPos and setting qt flags to Qt::WindowStaysOnBottomHint and SetParent as well as SetWindowLongPtr, but none of them seemed to work, did I use the wrong solution?

I am on Windows 11 btw.


Solution

  • There is no way to be bottom-most, only the desktop listview is allowed to do that.

    Anything trying to be a "desktop widget" involves hacks and you quickly run into What if two programs did this?

    • On startup and when/after you are clicked, call SetWindowPos to order yourself to the bottom.

    or