mirror of
https://github.com/MatsuriDayo/nekoray.git
synced 2025-12-17 20:44:38 +03:00
27 lines
569 B
Go
27 lines
569 B
Go
package main
|
|
|
|
import (
|
|
"syscall"
|
|
"unsafe"
|
|
)
|
|
|
|
// MessageBoxPlain of Win32 API.
|
|
func MessageBoxPlain(title, caption string) int {
|
|
const (
|
|
NULL = 0
|
|
MB_OK = 0
|
|
)
|
|
return MessageBox(NULL, caption, title, MB_OK)
|
|
}
|
|
|
|
// MessageBox of Win32 API.
|
|
func MessageBox(hwnd uintptr, caption, title string, flags uint) int {
|
|
ret, _, _ := syscall.NewLazyDLL("user32.dll").NewProc("MessageBoxW").Call(
|
|
uintptr(hwnd),
|
|
uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(caption))),
|
|
uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(title))),
|
|
uintptr(flags))
|
|
|
|
return int(ret)
|
|
}
|