Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions taskdialog.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,10 @@ type TaskDialog interface {
// Show synchronously displays a TaskDialog using opts and returns information
// about the dialog's state at the time it was dismissed, or an error.
Show(opts TaskDialogOpts) (result TaskDialogResult, err error)
// Created returns an Event that is triggered when the Task Dialog has been
// created but before it is displayed.
Created() *Event
// Created returns the event that is triggered when the Task Dialog has been
// created but before it is displayed. The event's argument references the
// [Win32Window] underlying the dialog.
Created() *GenericEvent[Win32Window]
// ExpandoClicked returns the event that is triggered when the Task Dialog's
// expando button is clicked (when present). The event's argument is true
// when the dialog is to be expanded, and false when the dialog is to be
Expand Down Expand Up @@ -284,7 +285,7 @@ type TaskDialog interface {
type taskDialog struct {
opts *TaskDialogOpts
hwnd win.HWND
created EventPublisher
created GenericEventPublisher[Win32Window]
expandoClicked ProceedWithArgEventPublisher[bool]
help EventPublisher
hyperlinkClicked ProceedWithArgEventPublisher[string]
Expand Down Expand Up @@ -539,7 +540,7 @@ func (td *taskDialog) Show(opts TaskDialogOpts) (result TaskDialogResult, err er
return result, nil
}

func (td *taskDialog) Created() *Event {
func (td *taskDialog) Created() *GenericEvent[Win32Window] {
return td.created.Event()
}

Expand Down Expand Up @@ -718,7 +719,8 @@ func (td *taskDialog) msgProc(hwnd win.HWND, msg uint32, wParam uintptr, lParam
td.configureUACButtons()
td.disableButtons()
td.maybeHideTitleBarIcon()
td.created.Publish()
ww := &Win32WindowImpl{hWnd: hwnd}
td.created.Publish(ww)
case win.TDN_NAVIGATED:
case win.TDN_BUTTON_CLICKED:
if td.handleButtonClicked(int32(wParam)) {
Expand Down