OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "app/win_util.h" | 5 #include "app/win_util.h" |
6 | 6 |
7 #include <commdlg.h> | 7 #include <commdlg.h> |
8 #include <dwmapi.h> | 8 #include <dwmapi.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #include <shlobj.h> | 10 #include <shlobj.h> |
11 | 11 |
12 #include <algorithm> | 12 #include <algorithm> |
13 | 13 |
14 #include "app/l10n_util.h" | 14 #include "app/l10n_util.h" |
15 #include "app/l10n_util_win.h" | 15 #include "app/l10n_util_win.h" |
16 #include "base/base_switches.h" | 16 #include "base/base_switches.h" |
17 #include "base/command_line.h" | 17 #include "base/command_line.h" |
18 #include "base/file_util.h" | 18 #include "base/file_util.h" |
19 #include "base/i18n/rtl.h" | 19 #include "base/i18n/rtl.h" |
20 #include "base/logging.h" | 20 #include "base/logging.h" |
21 #include "base/native_library.h" | 21 #include "base/native_library.h" |
22 #include "base/scoped_comptr_win.h" | 22 #include "base/scoped_comptr_win.h" |
23 #include "base/scoped_handle.h" | 23 #include "base/scoped_handle.h" |
24 #include "base/scoped_handle_win.h" | 24 #include "base/scoped_handle_win.h" |
25 #include "base/scoped_native_library.h" | |
26 #include "base/string_util.h" | 25 #include "base/string_util.h" |
27 #include "base/win_util.h" | 26 #include "base/win_util.h" |
28 #include "gfx/codec/png_codec.h" | 27 #include "gfx/codec/png_codec.h" |
29 #include "gfx/gdi_util.h" | 28 #include "gfx/gdi_util.h" |
30 | 29 |
31 // Ensure that we pick up this link library. | 30 // Ensure that we pick up this link library. |
32 #pragma comment(lib, "dwmapi.lib") | 31 #pragma comment(lib, "dwmapi.lib") |
33 | 32 |
34 namespace win_util { | 33 namespace win_util { |
35 | 34 |
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 HRESULT result = SHGetPropertyStoreForWindow( | 574 HRESULT result = SHGetPropertyStoreForWindow( |
576 hwnd, __uuidof(*pps), reinterpret_cast<void**>(pps.Receive())); | 575 hwnd, __uuidof(*pps), reinterpret_cast<void**>(pps.Receive())); |
577 if (S_OK == result) { | 576 if (S_OK == result) { |
578 SetAppIdForPropertyStore(pps, app_id.c_str()); | 577 SetAppIdForPropertyStore(pps, app_id.c_str()); |
579 } | 578 } |
580 | 579 |
581 // Cleanup. | 580 // Cleanup. |
582 base::UnloadNativeLibrary(shell32_library); | 581 base::UnloadNativeLibrary(shell32_library); |
583 } | 582 } |
584 | 583 |
585 void CallSetProcessDPIAware() { | |
586 // This functionality is only available on Vista or later. | |
587 if (win_util::GetWinVersion() < win_util::WINVERSION_VISTA) | |
588 return; | |
589 | |
590 base::ScopedNativeLibrary user32( | |
591 FilePath(base::GetNativeLibraryName(L"user32"))); | |
592 typedef BOOL (*SetProcessDPIAwareFunc)(); | |
593 SetProcessDPIAwareFunc set_process_dpi_aware = | |
594 (SetProcessDPIAwareFunc)user32.GetFunctionPointer("SetProcessDPIAware"); | |
595 if (set_process_dpi_aware) | |
596 set_process_dpi_aware(); | |
597 } | |
598 | |
599 } // namespace win_util | 584 } // namespace win_util |
OLD | NEW |