Skip to content

Commit

Permalink
Remove CLSID and self generate shortcut
Browse files Browse the repository at this point in the history
  • Loading branch information
vlabo committed Oct 18, 2022
1 parent 6c663fc commit 7617b96
Show file tree
Hide file tree
Showing 4 changed files with 971 additions and 964 deletions.
9 changes: 5 additions & 4 deletions src/notification_glue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@ class WinToastHandler : public IWinToastHandler
uint64_t m_id;
};

uint64_t PortmasterToastInitialize(const wchar_t *appName, const wchar_t *aumi) {
uint64_t PortmasterToastInitialize(const wchar_t *appName, const wchar_t *aumi, const wchar_t* originalShortcutPath) {
WinToast::instance()->setAppName(appName);
WinToast::instance()->setAppUserModelId(aumi);
WinToast::instance()->setShortcutPolicy(WinToast::SHORTCUT_POLICY_IGNORE);

WinToast::instance()->setAppUserModelId(L"test.amui");
WinToast::instance()->setShellLinkToCopy(originalShortcutPath);
WinToast::instance()->setShortcutPolicy(WinToast::SHORTCUT_POLICY_REQUIRE_CREATE);

WinToast::WinToastError error = WinToast::NoError;
WinToast::instance()->initialize(&error);
return error;
Expand Down
7 changes: 4 additions & 3 deletions src/notification_glue.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ typedef uint64_t(*callback_func)(uint64_t id, int action);
/**
* @brief Initialize notifications
*
* @par appName = application name, appears in the notification header
* @par aumi = Application User Mode ID. Identifer that should be set in the Portmaster start menu shortcut
* @par appName = application name, appears in the notification header
* @par aumi = Application User Mode ID. Identifier that should be set in the Portmaster start menu shortcut
* @par originalShortcutPath = The original shortcut that will be copied on initialization
* @return 1 on success 0 on failure
*
*/
EXPORT uint64_t PortmasterToastInitialize(const wchar_t* appName, const wchar_t* aumi);
EXPORT uint64_t PortmasterToastInitialize(const wchar_t* appName, const wchar_t* aumi, const wchar_t* originalShortcutPath);

/**
* @brief check if notifications are initialized
Expand Down
Loading

0 comments on commit 7617b96

Please sign in to comment.