Fix other

This commit is contained in:
2026-04-19 12:56:16 +02:00
parent 669c5b3011
commit 42effa04a5
7 changed files with 223 additions and 103 deletions

View File

@@ -1,6 +1,7 @@
package windows
import (
"os"
"syscall"
"unsafe"
)
@@ -10,8 +11,13 @@ const (
MB_OK = 0
)
func Fatal(title, message string, exitCode int) {
messageBox(NULL, message, title, MB_OK)
os.Exit(exitCode)
}
// MessageBox of Win32 API.
func MessageBox(hwnd uintptr, caption, title string, flags uint) int {
func messageBox(hwnd uintptr, caption, title string, flags uint) int {
_caption, err := syscall.UTF16PtrFromString(caption)
if err != nil {
panic(err)