diff options
Diffstat (limited to 'chrome_frame/utils.cc')
-rw-r--r-- | chrome_frame/utils.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/chrome_frame/utils.cc b/chrome_frame/utils.cc index 620865d..bd803bf 100644 --- a/chrome_frame/utils.cc +++ b/chrome_frame/utils.cc @@ -857,3 +857,12 @@ std::wstring GetActualUrlFromMoniker(IMoniker* moniker, return moniker_url; } +bool IsTopLevelWindow(HWND window) { + long style = GetWindowLong(window, GWL_STYLE); // NOLINT + if (!(style & WS_CHILD)) + return true; + + HWND parent = GetParent(window); + return !parent || (parent == GetDesktopWindow()); +} + |