Mercurial > minori
diff dep/animia/src/win/win32.cc @ 156:cdf79282d647
dep/animia: add VERY early x11 window stuff
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Wed, 15 Nov 2023 18:04:04 -0500 |
parents | bd439dd6ffc5 |
children | 0fc126d52de4 |
line wrap: on
line diff
--- a/dep/animia/src/win/win32.cc Wed Nov 15 15:24:39 2023 -0500 +++ b/dep/animia/src/win/win32.cc Wed Nov 15 18:04:04 2023 -0500 @@ -1,7 +1,7 @@ #include "animia/win/win32.h" +#include "animia.h" #include "animia/util/win32.h" #include "animia/win.h" -#include "animia.h" #include <set> #include <string> @@ -48,8 +48,7 @@ // Note that if we requested PROCESS_QUERY_INFORMATION access right instead // of PROCESS_QUERY_LIMITED_INFORMATION, this function would fail when used // to open an elevated process. - Handle process_handle(::OpenProcess( - PROCESS_QUERY_LIMITED_INFORMATION, FALSE, process_id)); + Handle process_handle(::OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION, FALSE, process_id)); if (!process_handle) return std::wstring(); @@ -72,12 +71,8 @@ const auto window_style = ::GetWindowLong(hwnd, GWL_STYLE); const auto window_ex_style = ::GetWindowLong(hwnd, GWL_EXSTYLE); - auto has_style = [&window_style](DWORD style) { - return (window_style & style) != 0; - }; - auto has_ex_style = [&window_ex_style](DWORD ex_style) { - return (window_ex_style & ex_style) != 0; - }; + auto has_style = [&window_style](DWORD style) { return (window_style & style) != 0; }; + auto has_ex_style = [&window_ex_style](DWORD ex_style) { return (window_ex_style & ex_style) != 0; }; // Toolbars, tooltips and similar topmost windows if (has_style(WS_POPUP) && has_ex_style(WS_EX_TOOLWINDOW)) @@ -90,18 +85,18 @@ static bool VerifyClassName(const std::wstring& name) { static const std::set<std::wstring> invalid_names = { - // System classes - L"#32770", // Dialog box - L"CabinetWClass", // Windows Explorer - L"ComboLBox", - L"DDEMLEvent", - L"DDEMLMom", - L"DirectUIHWND", - L"GDI+ Hook Window Class", - L"IME", - L"Internet Explorer_Hidden", - L"MSCTFIME UI", - L"tooltips_class32", + // System classes + L"#32770", // Dialog box + L"CabinetWClass", // Windows Explorer + L"ComboLBox", + L"DDEMLEvent", + L"DDEMLMom", + L"DirectUIHWND", + L"GDI+ Hook Window Class", + L"IME", + L"Internet Explorer_Hidden", + L"MSCTFIME UI", + L"tooltips_class32", }; return !name.empty() && !invalid_names.count(name); @@ -113,12 +108,12 @@ static bool VerifyProcessFileName(const std::wstring& name) { static const std::set<std::wstring> invalid_names = { - // System files - L"explorer", // Windows Explorer - L"taskeng", // Task Scheduler Engine - L"taskhost", // Host Process for Windows Tasks - L"taskhostex", // Host Process for Windows Tasks - L"Taskmgr", // Task Manager + // System files + L"explorer", // Windows Explorer + L"taskeng", // Task Scheduler Engine + L"taskhost", // Host Process for Windows Tasks + L"taskhostex", // Host Process for Windows Tasks + L"Taskmgr", // Task Manager }; return !name.empty() && !invalid_names.count(name); @@ -176,4 +171,4 @@ return ::EnumWindows(EnumWindowsProc, param) != FALSE; } -} // namespace animia::win::detail \ No newline at end of file +} // namespace animia::internal::win32 \ No newline at end of file