From 708da63009e5917306902e4c41fe2032c227ab06 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 19 Jan 2019 00:28:34 +0300 Subject: Toaster: fix for Start Menu folder path detection --- plugins/Toaster/src/stdafx.h | 1 + plugins/Toaster/src/utils.cpp | 6 ++---- 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 #include +#include #include #include #include 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); } -- cgit v1.2.3