I have two windows that I always need to be unobscured, even against windows that have alwaysOnTop
.
The alwayOnTop
subcommand is not full proof, for example if another window that also has alwaysOnTop
happens to be active, it can obscure a window that also has alwaysOnTop
, and then there are system windows (start, notifications) that seem to be above standard ‘on top’ windows
Searching a round there seems to be a way to do this, something to do with “zband” but its not well known and its to do with DLL calls, something I don’t know much about.
Apparently a few people figured out it, for example malcev and teadrinker.
I tried to rework malcev’s example, Alaways on Top Windows 10, and test it on a notepad window:
hwnd := DllCall("CreateWindowInBand", "uint", 0, "str", "Notepad", "str", "Untitled - Notepad", "uint", 0, "int", 0, "int", 0, "int", 200, "int", 200, "ptr", 0, "ptr", 0, "ptr", 0, "ptr", 0, "int", ZBID_UIACCESS := 2, "ptr")
if !a_lasterror
WinShow ahk_id %hwnd%
else
msgbox % a_lasterror
But when I run the code with a UI access interpreter, I keep getting a 1407
error, from searching around this is a “class not found error”, but Spy says the class is Notepad
…
I have tried to solve this on my own but examples are sparse and I am not getting anywhere, I would appreciate any pointers or solutions. Thanks.