mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
FancyZones: filter out WM_POPUP windows if they dont have maximize/minimize button or a sizable frame (#1212)
This filters out TaskView and Win32 menus.
This commit is contained in:
committed by
GitHub
parent
ed35a143ec
commit
0ecfbfad53
@@ -80,6 +80,14 @@ bool HWNDDataCache::is_invalid_class(HWND hwnd) const {
|
|||||||
}
|
}
|
||||||
bool HWNDDataCache::is_invalid_style(HWND hwnd) const {
|
bool HWNDDataCache::is_invalid_style(HWND hwnd) const {
|
||||||
auto style = GetWindowLong(hwnd, GWL_STYLE);
|
auto style = GetWindowLong(hwnd, GWL_STYLE);
|
||||||
|
// WS_POPUP need to have a border or minimize/maximize buttons,
|
||||||
|
// otherwise the window is "not interesting"
|
||||||
|
if ((style & WS_POPUP) == WS_POPUP &&
|
||||||
|
(style & WS_THICKFRAME) == 0 &&
|
||||||
|
(style & WS_MINIMIZEBOX) == 0 &&
|
||||||
|
(style & WS_MAXIMIZEBOX) == 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
for (auto invalid : invalid_basic_styles) {
|
for (auto invalid : invalid_basic_styles) {
|
||||||
if ((invalid & style) != 0) {
|
if ((invalid & style) != 0) {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user