commit cec7e6e4b3dc1c43af3e01d840a4d8ebf29e1eeb
parent ce23bc2275c66199b2a0c78c4ce0eff12579243c
Author: Jack Mordaunt <jackmordaunt.dev@gmail.com>
Date: Wed, 22 Mar 2023 14:34:29 +0800
wintoast: allow per app GUID override
Let the caller supply their own GUID.
Signed-off-by: Jack Mordaunt <jackmordaunt.dev@gmail.com>
Diffstat:
3 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/wintoast/bind.go b/wintoast/bind.go
@@ -7,6 +7,7 @@ import "errors"
// See toast.Notification for more thorough documentation off these fields.
type AppData struct {
AppID string
+ GUID string
ActivationExe string // optional
IconPath string // optional
IconBackgroundColor string // optional
diff --git a/wintoast/bind_windows.go b/wintoast/bind_windows.go
@@ -111,6 +111,10 @@ func setAppData(data AppData) (err error) {
return nil
}
+ if data.GUID != "" {
+ GUID_ImplNotificationActivationCallback = ole.NewGUID(data.GUID)
+ }
+
// Keep a copy of the saved data for later.
defer func() {
if err == nil {
diff --git a/wintoast/interfaces.go b/wintoast/interfaces.go
@@ -38,7 +38,7 @@ var (
IID_IXmlDocumentIO = ole.NewGUID("{6CD0E74E-EE65-4489-9EBF-CA43E87BA637}")
)
-// This GUID is for our implementation.
+// This default GUID is for our implementation.
// This was generated and should not collide with any other GUID.
var GUID_ImplNotificationActivationCallback = ole.NewGUID("{0F82E845-CB89-4039-BDBF-67CA33254C76}")