summaryrefslogtreecommitdiffstats
path: root/app/win_util.cc
diff options
context:
space:
mode:
Diffstat (limited to 'app/win_util.cc')
-rw-r--r--app/win_util.cc14
1 files changed, 2 insertions, 12 deletions
diff --git a/app/win_util.cc b/app/win_util.cc
index b3b66c2..9e1587e 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);
}