MCPcopy
hub / github.com/wailsapp/wails / MessageBox

Function MessageBox

v2/internal/webview2runtime/webview2runtime.go:147–163  ·  view source on GitHub ↗

MessageBox prompts the user with the given caption and title. Flags may be provided to customise the dialog. Returns an error if something went wrong.

(caption string, title string, flags uint)

Source from the content-addressed store, hash-verified

145// Flags may be provided to customise the dialog.
146// Returns an error if something went wrong.
147func MessageBox(caption string, title string, flags uint) (int, error) {
148 captionUTF16, err := syscall.UTF16PtrFromString(caption)
149 if err != nil {
150 return -1, err
151 }
152 titleUTF16, err := syscall.UTF16PtrFromString(title)
153 if err != nil {
154 return -1, err
155 }
156 ret, _, _ := syscall.NewLazyDLL("user32.dll").NewProc("MessageBoxW").Call(
157 uintptr(0),
158 uintptr(unsafe.Pointer(captionUTF16)),
159 uintptr(unsafe.Pointer(titleUTF16)),
160 uintptr(flags))
161
162 return int(ret), nil
163}
164
165// OpenInstallerDownloadWebpage will open the browser on the WebView2 download page
166func OpenInstallerDownloadWebpage() error {

Callers 2

ConfirmFunction · 0.70
ErrorFunction · 0.70

Calls 1

CallMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…