From ba6758788a83706e0b240fff7d93050656c8449e Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Sat, 29 Aug 2015 12:59:53 +0000 Subject: Toaster: code cleanup; version bump git-svn-id: http://svn.miranda-ng.org/main/trunk@15090 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Toaster/src/stdafx.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'plugins/Toaster/src/stdafx.h') diff --git a/plugins/Toaster/src/stdafx.h b/plugins/Toaster/src/stdafx.h index 2e2e59cd1c..f5c193c328 100644 --- a/plugins/Toaster/src/stdafx.h +++ b/plugins/Toaster/src/stdafx.h @@ -50,8 +50,17 @@ int OnPreShutdown(WPARAM, LPARAM); INT_PTR Service(WPARAM, LPARAM); HRESULT ShortcutExists(); wchar_t* GetShortcutPath(); -HRESULT TryCreateShortcut(); HRESULT InstallShortcut(_In_z_ wchar_t *shortcutPath); +__forceinline HRESULT TryCreateShortcut() +{ + return (ShortcutExists() ? S_OK : InstallShortcut(ptrW(GetShortcutPath()))); +} + +__forceinline HRESULT ShortcutExists() +{ + return (!(GetFileAttributes(ptrW(GetShortcutPath())) < 0xFFFFFFF) ? S_OK : S_FALSE); +} + #endif //_COMMON_H_ -- cgit v1.2.3