summaryrefslogtreecommitdiff
path: root/dialog_windows.go
diff options
context:
space:
mode:
Diffstat (limited to 'dialog_windows.go')
-rw-r--r--dialog_windows.go18
1 files changed, 7 insertions, 11 deletions
diff --git a/dialog_windows.go b/dialog_windows.go
index c6da94b..45a2a73 100644
--- a/dialog_windows.go
+++ b/dialog_windows.go
@@ -30,21 +30,17 @@ func _msgBox(parent *Window, primarytext string, secondarytext string, uType uin
go func() {
ret := make(chan uiret)
defer close(ret)
- uitask <- &uimsg{
- call: _messageBox,
- p: []uintptr{
+ uitask <- func() {
+ r1, _, err := _messageBox.Call(
uintptr(parenthwnd),
utf16ToArg(ptext),
utf16ToArg(ptitle),
- uintptr(uType),
- },
- ret: ret,
+ uintptr(uType))
+ if r1 == 0 { // failure
+ panic(fmt.Sprintf("error displaying message box to user: %v\nstyle: 0x%08X\ntitle: %q\ntext:\n%s", err, uType, os.Args[0], text))
+ }
+ retchan <- int(r1)
}
- r := <-ret
- if r.ret == 0 { // failure
- panic(fmt.Sprintf("error displaying message box to user: %v\nstyle: 0x%08X\ntitle: %q\ntext:\n%s", r.err, uType, os.Args[0], text))
- }
- retchan <- int(r.ret)
}()
return retchan
}