summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-01-19 00:28:34 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-01-19 00:28:34 +0300
commit708da63009e5917306902e4c41fe2032c227ab06 (patch)
tree7771eafb349b0ae6090ccf88baaeb4ffa05cdfa4 /plugins
parent79c8ff11ee17dbc4d08523c76cdbb2590097e838 (diff)
Toaster: fix for Start Menu folder path detection
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Toaster/src/stdafx.h1
-rw-r--r--plugins/Toaster/src/utils.cpp6
2 files changed, 3 insertions, 4 deletions
diff --git a/plugins/Toaster/src/stdafx.h b/plugins/Toaster/src/stdafx.h
index 460861ee91..aecd986516 100644
--- a/plugins/Toaster/src/stdafx.h
+++ b/plugins/Toaster/src/stdafx.h
@@ -5,6 +5,7 @@
#include <wrl/implements.h>
#include <windows.ui.notifications.h>
+#include <ShlObj.h>
#include <ShObjIdl.h>
#include <propvarutil.h>
#include <memory>
diff --git a/plugins/Toaster/src/utils.cpp b/plugins/Toaster/src/utils.cpp
index 7726eec8c5..9751dcb13f 100644
--- a/plugins/Toaster/src/utils.cpp
+++ b/plugins/Toaster/src/utils.cpp
@@ -1,14 +1,12 @@
#include "stdafx.h"
-#define SHORTCUT_PATH "\\Microsoft\\Windows\\Start Menu\\Programs\\Miranda NG.lnk"
-
using namespace Microsoft::WRL;
wchar_t* GetShortcutPath()
{
wchar_t path[MAX_PATH];
- GetEnvironmentVariable(L"APPDATA", path, MAX_PATH);
- wcscat_s(path, _T(SHORTCUT_PATH));
+ SHGetSpecialFolderPathW(nullptr, path, CSIDL_STARTMENU, FALSE);
+ wcscat_s(path, L"\\Programs\\Miranda NG.lnk");
return mir_wstrdup(path);
}