summaryrefslogtreecommitdiff
path: root/plugins/Toaster/src/add_to_start_menu.h
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Toaster/src/add_to_start_menu.h')
-rw-r--r--plugins/Toaster/src/add_to_start_menu.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/plugins/Toaster/src/add_to_start_menu.h b/plugins/Toaster/src/add_to_start_menu.h
new file mode 100644
index 0000000000..0fd3bf6171
--- /dev/null
+++ b/plugins/Toaster/src/add_to_start_menu.h
@@ -0,0 +1,12 @@
+wchar_t* GetShortcutPath();
+HRESULT InstallShortcut(_In_z_ wchar_t *shortcutPath);
+
+__forceinline bool ShortcutExists()
+{
+ return !(GetFileAttributes(ptrW(GetShortcutPath())) < 0xFFFFFFF);
+}
+
+__forceinline HRESULT TryCreateShortcut()
+{
+ return (ShortcutExists() ? S_OK : InstallShortcut(ptrW(GetShortcutPath())));
+} \ No newline at end of file