diff options
Diffstat (limited to 'chrome/common/platform_util_win.cc')
-rw-r--r-- | chrome/common/platform_util_win.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/chrome/common/platform_util_win.cc b/chrome/common/platform_util_win.cc index 16ea8c0..1925122 100644 --- a/chrome/common/platform_util_win.cc +++ b/chrome/common/platform_util_win.cc @@ -15,6 +15,7 @@ #include "base/file_util.h" #include "base/gfx/native_widget_types.h" #include "base/logging.h" +#include "base/string_util.h" #include "chrome/common/win_util.h" namespace platform_util { @@ -85,4 +86,11 @@ gfx::NativeWindow GetTopLevel(gfx::NativeView view) { return GetAncestor(view, GA_ROOT); } +string16 GetWindowTitle(gfx::NativeWindow window_handle) { + std::wstring result; + int length = ::GetWindowTextLength(window_handle) + 1; + ::GetWindowText(window_handle, WriteInto(&result, length), length); + return WideToUTF16(result); +} + } // namespace platform_util |