-
Notifications
You must be signed in to change notification settings - Fork 871
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add DWMWA_CLOAK support on Windows #3576
base: master
Are you sure you want to change the base?
Conversation
/// Cloaks the window such that it is not visible to the user. The window is still composed by DWM. | ||
/// | ||
/// Not supported on Windows 7 and earlier. | ||
fn set_cloaked(&self, cloaked: bool); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds like content protected? Or what it means here? Like it's not visible, but you can screen capture it? Like overlay, etc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This description was copy pasted from the winapi docs, but basically DWMWA_CLOAK
makes a window invisible.
This is explained in detail here: https://devblogs.microsoft.com/oldnewthing/20200302-00/?p=103507
The shell has a concept called cloaking, in which a window is given all the trappings of visibility, without actually being presented to the user. As far as the app can tell, it seems to be visible: It still has the WS_VISIBLE window style, its coordinates are still within the bounds of the monitor, it still gets WM_PAINT messages, it has a non-empty clipping region, all the ways a traditional Win32 app has of detecting whether it is on screen say, “Yup, you’re on screen. Everything is just fine!”
From the user's perspective, an invisible window will not show up on the taskbar, but a cloaked window will.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nit: A cloaked window will not appear on Taskbar. Cloaking is particularly useful when you want a window to complete its UI layout, sizing, etc. without flickering in front of the user.
CHANGELOG.md
if knowledge of this change could be valuable to usersTested on Windows 11 build 22621.3155
At least one application is using this attribute: vizia/vizia#386
DWMWA_CLOAK is explained in detail in this blog post: https://devblogs.microsoft.com/oldnewthing/20200302-00/?p=103507