summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/win/window_impl.cc10
-rw-r--r--app/win/window_impl.h3
2 files changed, 13 insertions, 0 deletions
diff --git a/app/win/window_impl.cc b/app/win/window_impl.cc
index 9668f82..5488434 100644
--- a/app/win/window_impl.cc
+++ b/app/win/window_impl.cc
@@ -152,6 +152,16 @@ HICON WindowImpl::GetDefaultWindowIcon() const {
return NULL;
}
+// static
+bool WindowImpl::IsWindowImpl(HWND hwnd) {
+ wchar_t tmp[128];
+ if (!::GetClassName(hwnd, tmp, 128))
+ return false;
+
+ std::wstring class_name(tmp);
+ return class_name.find(kBaseClassName) == 0;
+}
+
LRESULT WindowImpl::OnWndProc(UINT message, WPARAM w_param, LPARAM l_param) {
LRESULT result = 0;
diff --git a/app/win/window_impl.h b/app/win/window_impl.h
index ad1fc87..67f3bf7 100644
--- a/app/win/window_impl.h
+++ b/app/win/window_impl.h
@@ -70,6 +70,9 @@ class WindowImpl : public MessageMapInterface {
}
UINT initial_class_style() const { return class_style_; }
+ // Returns true if the specified |hwnd| is a WindowImpl.
+ static bool IsWindowImpl(HWND hwnd);
+
protected:
// Handles the WndProc callback for this object.
virtual LRESULT OnWndProc(UINT message, WPARAM w_param, LPARAM l_param);