Index: ui/base/win/shell.cc |
diff --git a/ui/base/win/shell.cc b/ui/base/win/shell.cc |
index df90108ac4fb86d451aa63ea37fbd3b57f3a108b..0f955375e527ce189d0a5431085591f97199f931 100644 |
--- a/ui/base/win/shell.cc |
+++ b/ui/base/win/shell.cc |
@@ -98,6 +98,22 @@ bool OpenItemViaShellNoZoneCheck(const base::FilePath& full_path) { |
SEE_MASK_NOZONECHECKS | SEE_MASK_FLAG_DDEWAIT); |
} |
+bool PreventWindowFromPinning(HWND hwnd) { |
+ // This functionality is only available on Win7+. It also doesn't make sense |
+ // to do this for Chrome Metro. |
+ if (base::win::GetVersion() < base::win::VERSION_WIN7 || |
+ base::win::IsMetroProcess()) |
+ return false; |
+ base::win::ScopedComPtr<IPropertyStore> pps; |
+ HRESULT result = SHGetPropertyStoreForWindow( |
+ hwnd, __uuidof(*pps), reinterpret_cast<void**>(pps.Receive())); |
+ if (FAILED(result)) |
+ return false; |
+ |
+ return base::win::SetBooleanValueForPropertyStore( |
+ pps, PKEY_AppUserModel_PreventPinning, true); |
+} |
+ |
void SetAppIdForWindow(const string16& app_id, HWND hwnd) { |
SetAppDetailsForWindow(app_id, string16(), string16(), string16(), hwnd); |
} |