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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 return true; | 314 return true; |
315 } | 315 } |
316 | 316 |
317 bool TaskbarPinShortcutLink(const wchar_t* shortcut) { | 317 bool TaskbarPinShortcutLink(const wchar_t* shortcut) { |
318 base::ThreadRestrictions::AssertIOAllowed(); | 318 base::ThreadRestrictions::AssertIOAllowed(); |
319 | 319 |
320 // "Pin to taskbar" is only supported after Win7. | 320 // "Pin to taskbar" is only supported after Win7. |
321 if (GetVersion() < VERSION_WIN7) | 321 if (GetVersion() < VERSION_WIN7) |
322 return false; | 322 return false; |
323 | 323 |
324 int result = reinterpret_cast<int>(ShellExecute(NULL, L"taskbarpin", shortcut, | 324 intptr_t result = reinterpret_cast<intptr_t>( |
325 NULL, NULL, 0)); | 325 ShellExecute(NULL, L"taskbarpin", shortcut, NULL, NULL, 0)); |
326 return result > 32; | 326 return result > 32; |
327 } | 327 } |
328 | 328 |
329 bool TaskbarUnpinShortcutLink(const wchar_t* shortcut) { | 329 bool TaskbarUnpinShortcutLink(const wchar_t* shortcut) { |
330 base::ThreadRestrictions::AssertIOAllowed(); | 330 base::ThreadRestrictions::AssertIOAllowed(); |
331 | 331 |
332 // "Unpin from taskbar" is only supported after Win7. | 332 // "Unpin from taskbar" is only supported after Win7. |
333 if (GetVersion() < VERSION_WIN7) | 333 if (GetVersion() < VERSION_WIN7) |
334 return false; | 334 return false; |
335 | 335 |
336 int result = reinterpret_cast<int>(ShellExecute(NULL, L"taskbarunpin", | 336 intptr_t result = reinterpret_cast<intptr_t>( |
337 shortcut, NULL, NULL, 0)); | 337 ShellExecute(NULL, L"taskbarunpin", shortcut, NULL, NULL, 0)); |
338 return result > 32; | 338 return result > 32; |
339 } | 339 } |
340 | 340 |
341 } // namespace win | 341 } // namespace win |
342 } // namespace base | 342 } // namespace base |
OLD | NEW |