Closed knausj85 closed 4 years ago
Doing a bit of research out of curiosity, looks like this is the ticket in win32 land FWIW.
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowpos
"A window can be made a topmost window either by setting the hWndInsertAfter parameter to HWND_TOPMOST and ensuring that the SWP_NOZORDER flag is not set, or by setting a window's position in the Z order so that it is above any existing topmost windows. When a non-topmost window is made topmost, its owned windows are also made topmost. Its owners, however, are not changed."
Poking around optikey, looks like it takes advantage of the bolded implementation detail, main window is top-most, and every new child is thus. Didn't see any fancy stuff.
Might be worth exposing via the canvas api someday too, if not already
Try in 962
No luck.
I'm calling
SetWindowPos((HWND)win->winId(), HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE);
After a little more research, it looks like this probably goes back to uiAccess and signing.
https://docs.microsoft.com/en-us/windows/win32/winauto/uiauto-securityoverview
"In addition to having access to higher IL processes, an assistive technology application with UIAccess can run as the topmost application in the z-order at any time, meaning that an assistive technology application can be visible and available whenever the user needs it."
My bad.
This also has some likely useful tips
https://github.com/OptiKey/OptiKey/blob/master/docs/UiAccess.md