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)
| 145 | // Flags may be provided to customise the dialog. |
| 146 | // Returns an error if something went wrong. |
| 147 | func 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 |
| 166 | func OpenInstallerDownloadWebpage() error { |