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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
173 if (FAILED(InitPropVariantFromString(property_string_value, &property_value))) | 173 if (FAILED(InitPropVariantFromString(property_string_value, &property_value))) |
174 return false; | 174 return false; |
175 | 175 |
176 return SetPropVariantValueForPropertyStore(property_store, | 176 return SetPropVariantValueForPropertyStore(property_store, |
177 property_key, | 177 property_key, |
178 &property_value); | 178 &property_value); |
179 } | 179 } |
180 | 180 |
181 bool SetAppIdForPropertyStore(IPropertyStore* property_store, | 181 bool SetAppIdForPropertyStore(IPropertyStore* property_store, |
182 const wchar_t* app_id) { | 182 const wchar_t* app_id) { |
183 // App id should be less than 128 chars and contain no space. And recommended | 183 // App id should be less than 64 chars and contain no space. And recommended |
robertshield
2012/06/20 21:50:16
this does not look to be part of the CL descriptio
gab
2012/06/20 21:58:36
Done.
| |
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) < 64 && 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 return SetBooleanValueForPropertyStore(property_store, | 194 return SetBooleanValueForPropertyStore(property_store, |
195 PKEY_AppUserModel_DualMode, | 195 PKEY_AppUserModel_DualMode, |
196 true) && | 196 true) && |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
246 | 246 |
247 #ifndef COPY_FILE_COPY_SYMLINK | 247 #ifndef COPY_FILE_COPY_SYMLINK |
248 #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 \ |
249 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 \ |
250 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. \ |
251 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 \ |
252 "Integrate Windows SDK with Visual Studio 2005" from the Windows SDK \ | 252 "Integrate Windows SDK with Visual Studio 2005" from the Windows SDK \ |
253 menu (see Start - All Programs - Microsoft Windows SDK - \ | 253 menu (see Start - All Programs - Microsoft Windows SDK - \ |
254 Visual Studio Registration). | 254 Visual Studio Registration). |
255 #endif | 255 #endif |
OLD | NEW |