From 8bfb987717dc3994bae1aaa78ece779c97340850 Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Sat, 29 Aug 2015 09:33:23 +0000 Subject: AddToStartMenu functianally moved to Toaster git-svn-id: http://svn.miranda-ng.org/main/trunk@15083 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Toaster/src/main.cpp | 8 ++------ plugins/Toaster/src/stdafx.h | 11 +++++++++++ 2 files changed, 13 insertions(+), 6 deletions(-) (limited to 'plugins/Toaster/src') diff --git a/plugins/Toaster/src/main.cpp b/plugins/Toaster/src/main.cpp index 15bef82d99..ccfedcefa1 100644 --- a/plugins/Toaster/src/main.cpp +++ b/plugins/Toaster/src/main.cpp @@ -45,13 +45,9 @@ extern "C" int __declspec(dllexport) Load(void) if (IsWinVer8Plus() && !IsWinVer10Plus()) { - if (ServiceExists("AddToStartMenu/Add")) + if (FAILED(TryCreateShortcut())) { - CallService("AddToStartMenu/Add"); - } - else - { - MessageBox(NULL, TranslateT("In Windows8 desktop application must have a shortcut on the Start menu. Please, install \"AddToStartMenu\" plugin."), _T(MODULE), MB_OK | MB_ICONERROR); + MessageBox(NULL, TranslateT("Failed create shortcut"), _T(MODULE), MB_OK | MB_ICONERROR); } } diff --git a/plugins/Toaster/src/stdafx.h b/plugins/Toaster/src/stdafx.h index a0dc262a7d..2e2e59cd1c 100644 --- a/plugins/Toaster/src/stdafx.h +++ b/plugins/Toaster/src/stdafx.h @@ -5,6 +5,8 @@ #include #include +#include +#include #include #include @@ -23,6 +25,7 @@ typedef void(__cdecl *pEventHandler)(void*); const wchar_t AppUserModelID[] = _T("MirandaNG"); +DEFINE_PROPERTYKEY(PKEY_AppUserModel_ID, 0x9F4C2855, 0x9F79, 0x4B39, 0xA8, 0xD0, 0xE1, 0xD4, 0x2D, 0xE1, 0xD5, 0xF3, 5); #include "string_reference_wrapper.h" #include "toast_event_handler.h" @@ -43,4 +46,12 @@ extern HINSTANCE g_hInstance; void InitServices(); int OnPreShutdown(WPARAM, LPARAM); + +INT_PTR Service(WPARAM, LPARAM); +HRESULT ShortcutExists(); +wchar_t* GetShortcutPath(); +HRESULT TryCreateShortcut(); +HRESULT InstallShortcut(_In_z_ wchar_t *shortcutPath); + + #endif //_COMMON_H_ -- cgit v1.2.3