Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2407)

Unified Diff: app/win_util.cc

Issue 399045: Set prop app id for chromium/application shortcut. (Closed)
Patch Set: more for hbono Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/file_util.h » ('j') | base/win_util.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app/win_util.cc
diff --git a/app/win_util.cc b/app/win_util.cc
index b3b66c25a92ee5d861fe301e2928fe457b9e3c57..9e1587e391010cceab26639b7ac2d3b09f2fcf94 100644
--- a/app/win_util.cc
+++ b/app/win_util.cc
@@ -6,7 +6,6 @@
#include <commdlg.h>
#include <dwmapi.h>
-#include <propvarutil.h>
#include <shellapi.h>
#include <shlobj.h>
@@ -47,10 +46,6 @@ typedef DECLSPEC_IMPORT HRESULT (STDAPICALLTYPE *SHGPSFW)(HWND hwnd,
REFIID riid,
void** ppv);
-EXTERN_C const PROPERTYKEY DECLSPEC_SELECTANY PKEY_AppUserModel_ID =
- { { 0x9F4C2855, 0x9F79, 0x4B39,
- { 0xA8, 0xD0, 0xE1, 0xD4, 0x2D, 0xE1, 0xD5, 0xF3, } }, 5 };
-
// Enforce visible dialog box.
UINT_PTR CALLBACK SaveAsDialogHook(HWND dialog, UINT message,
WPARAM wparam, LPARAM lparam) {
@@ -854,7 +849,7 @@ gfx::Font GetWindowTitleFont() {
}
void SetAppIdForWindow(const std::wstring& app_id, HWND hwnd) {
- // This funcationality is only available on Win7+.
+ // This functionality is only available on Win7+.
if (win_util::GetWinVersion() != win_util::WINVERSION_WIN7)
return;
@@ -879,20 +874,15 @@ void SetAppIdForWindow(const std::wstring& app_id, HWND hwnd) {
}
// Set the application's name.
- PROPVARIANT pv;
- InitPropVariantFromString(app_id.c_str(), &pv);
-
ScopedComPtr<IPropertyStore> pps;
SHGPSFW SHGetPropertyStoreForWindow = static_cast<SHGPSFW>(function);
HRESULT result = SHGetPropertyStoreForWindow(
hwnd, __uuidof(*pps), reinterpret_cast<void**>(pps.Receive()));
if (S_OK == result) {
- if (S_OK == pps->SetValue(PKEY_AppUserModel_ID, pv))
- pps->Commit();
+ SetAppIdForPropertyStore(pps, app_id.c_str());
}
// Cleanup.
- PropVariantClear(&pv);
base::UnloadNativeLibrary(shell32_library);
}
« no previous file with comments | « no previous file | base/file_util.h » ('j') | base/win_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698