go-toast

Send toast notifications in Windows
Log | Files | Refs | README | LICENSE

commit 194b232c28cedca42432d94adf098ebcee704729
parent 53f39c0056b10f322628fcc9817aa76561ea834b
Author: Jack Mordaunt <jackmordaunt.dev@gmail.com>
Date:   Wed, 15 Mar 2023 19:18:45 +0800

bind: surface DLL availability

This will be used to implement a powershell fallback.

Signed-off-by: Jack Mordaunt <jackmordaunt.dev@gmail.com>

Diffstat:
Minternal/bind/bind.go | 5+++++
1 file changed, 5 insertions(+), 0 deletions(-)

diff --git a/internal/bind/bind.go b/internal/bind/bind.go @@ -27,6 +27,11 @@ var ( procSetActivationCallback = toast.NewProc("SetActivationCallback") ) +// IsDLLAvailable returns true if the DLL can be loaded. +func IsDLLAvailable() bool { + return toast.Load() == nil +} + // GenerateToast notification via the specified xml content. // // No validation is performed on this xml content and the caller assumes responsibility