OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/win/win_util.h" | 5 #include "base/win/win_util.h" |
6 | 6 |
7 #include <aclapi.h> | 7 #include <aclapi.h> |
8 #include <shobjidl.h> // Must be before propkey. | 8 #include <shobjidl.h> // Must be before propkey. |
9 #include <propkey.h> | 9 #include <propkey.h> |
10 #include <propvarutil.h> | 10 #include <propvarutil.h> |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 // format is CompanyName.ProductName[.SubProduct.ProductNumber]. | 184 // format is CompanyName.ProductName[.SubProduct.ProductNumber]. |
185 // See http://msdn.microsoft.com/en-us/library/dd378459%28VS.85%29.aspx | 185 // See http://msdn.microsoft.com/en-us/library/dd378459%28VS.85%29.aspx |
186 DCHECK(lstrlen(app_id) < 128 && wcschr(app_id, L' ') == NULL); | 186 DCHECK(lstrlen(app_id) < 128 && wcschr(app_id, L' ') == NULL); |
187 | 187 |
188 return SetStringValueForPropertyStore(property_store, | 188 return SetStringValueForPropertyStore(property_store, |
189 PKEY_AppUserModel_ID, | 189 PKEY_AppUserModel_ID, |
190 app_id); | 190 app_id); |
191 } | 191 } |
192 | 192 |
193 bool SetDualModeForPropertyStore(IPropertyStore* property_store) { | 193 bool SetDualModeForPropertyStore(IPropertyStore* property_store) { |
194 DCHECK_GE(base::win::GetVersion(), base::win::VERSION_WIN8); | |
195 | |
196 return SetBooleanValueForPropertyStore(property_store, | 194 return SetBooleanValueForPropertyStore(property_store, |
197 PKEY_AppUserModel_DualMode, | 195 PKEY_AppUserModel_DualMode, |
198 true) && | 196 true) && |
199 SetUInt32ValueForPropertyStore(property_store, | 197 SetUInt32ValueForPropertyStore(property_store, |
200 PKEY_AppUserModel_DualMode_UK, | 198 PKEY_AppUserModel_DualMode_UK, |
201 1U); | 199 1U); |
202 } | 200 } |
203 | 201 |
204 static const char16 kAutoRunKeyPath[] = | 202 static const char16 kAutoRunKeyPath[] = |
205 L"Software\\Microsoft\\Windows\\CurrentVersion\\Run"; | 203 L"Software\\Microsoft\\Windows\\CurrentVersion\\Run"; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 | 246 |
249 #ifndef COPY_FILE_COPY_SYMLINK | 247 #ifndef COPY_FILE_COPY_SYMLINK |
250 #error You must install the Windows 2008 or Vista Software Development Kit and \ | 248 #error You must install the Windows 2008 or Vista Software Development Kit and \ |
251 set it as your default include path to build this library. You can grab it by \ | 249 set it as your default include path to build this library. You can grab it by \ |
252 searching for "download windows sdk 2008" in your favorite web search engine. \ | 250 searching for "download windows sdk 2008" in your favorite web search engine. \ |
253 Also make sure you register the SDK with Visual Studio, by selecting \ | 251 Also make sure you register the SDK with Visual Studio, by selecting \ |
254 "Integrate Windows SDK with Visual Studio 2005" from the Windows SDK \ | 252 "Integrate Windows SDK with Visual Studio 2005" from the Windows SDK \ |
255 menu (see Start - All Programs - Microsoft Windows SDK - \ | 253 menu (see Start - All Programs - Microsoft Windows SDK - \ |
256 Visual Studio Registration). | 254 Visual Studio Registration). |
257 #endif | 255 #endif |
OLD | NEW |