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/shortcut.h" | 5 #include "base/win/shortcut.h" |
6 | 6 |
7 #include <shellapi.h> | 7 #include <shellapi.h> |
8 #include <shlobj.h> | 8 #include <shlobj.h> |
9 #include <propkey.h> | 9 #include <propkey.h> |
10 | 10 |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
136 return false; | 136 return false; |
137 } | 137 } |
138 if (has_dual_mode && | 138 if (has_dual_mode && |
139 !SetBooleanValueForPropertyStore(property_store, | 139 !SetBooleanValueForPropertyStore(property_store, |
140 PKEY_AppUserModel_IsDualMode, | 140 PKEY_AppUserModel_IsDualMode, |
141 properties.dual_mode)) { | 141 properties.dual_mode)) { |
142 return false; | 142 return false; |
143 } | 143 } |
144 } | 144 } |
145 | 145 |
146 if ((properties.options & ShortcutProperties::PROPERTIES_HOTKEY) && | |
147 FAILED(i_shell_link->SetHotkey(LOWORD(properties.hotkey)))) { | |
robertshield
2013/11/04 02:19:55
nit: indent
cpu_(ooo_6.6-7.5)
2013/11/04 19:10:57
Done.
| |
148 return false; | |
149 } | |
150 | |
146 // Release the interfaces to the old shortcut to make sure it doesn't prevent | 151 // Release the interfaces to the old shortcut to make sure it doesn't prevent |
147 // overwriting it if needed. | 152 // overwriting it if needed. |
148 old_i_persist_file.Release(); | 153 old_i_persist_file.Release(); |
149 old_i_shell_link.Release(); | 154 old_i_shell_link.Release(); |
150 | 155 |
151 HRESULT result = i_persist_file->Save(shortcut_path.value().c_str(), TRUE); | 156 HRESULT result = i_persist_file->Save(shortcut_path.value().c_str(), TRUE); |
152 | 157 |
153 // Release the interfaces in case the SHChangeNotify call below depends on | 158 // Release the interfaces in case the SHChangeNotify call below depends on |
154 // the operations above being fully completed. | 159 // the operations above being fully completed. |
155 i_persist_file.Release(); | 160 i_persist_file.Release(); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
240 if (base::win::GetVersion() < base::win::VERSION_WIN7) | 245 if (base::win::GetVersion() < base::win::VERSION_WIN7) |
241 return false; | 246 return false; |
242 | 247 |
243 int result = reinterpret_cast<int>(ShellExecute(NULL, L"taskbarunpin", | 248 int result = reinterpret_cast<int>(ShellExecute(NULL, L"taskbarunpin", |
244 shortcut, NULL, NULL, 0)); | 249 shortcut, NULL, NULL, 0)); |
245 return result > 32; | 250 return result > 32; |
246 } | 251 } |
247 | 252 |
248 } // namespace win | 253 } // namespace win |
249 } // namespace base | 254 } // namespace base |
OLD | NEW |