summaryrefslogtreecommitdiff
path: root/messagebox.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-02-11 13:06:12 -0500
committerPietro Gagliardi <[email protected]>2014-02-11 13:06:12 -0500
commit42229820d2a47594f68d92356f8e8a86133a29f5 (patch)
tree3cd5deef283b4540bae2f75c049a5e69d4e9db20 /messagebox.go
parenta488e3ab36de1d6a329110fbaae44cd5747c854b (diff)
Added _windows.go extensions to all the files in preparation for the library writing.
Diffstat (limited to 'messagebox.go')
-rw-r--r--messagebox.go85
1 files changed, 0 insertions, 85 deletions
diff --git a/messagebox.go b/messagebox.go
deleted file mode 100644
index ba50f61..0000000
--- a/messagebox.go
+++ /dev/null
@@ -1,85 +0,0 @@
-// 7 february 2014
-package main
-
-import (
- "syscall"
- "unsafe"
-)
-
-// MessageBox button types.
-const (
- MB_ABORTRETRYIGNORE = 0x00000002
- MB_CANCELTRYCONTINUE = 0x00000006
- MB_HELP = 0x00004000
- MB_OK = 0x00000000
- MB_OKCANCEL = 0x00000001
- MB_RETRYCANCEL = 0x00000005
- MB_YESNO = 0x00000004
- MB_YESNOCANCEL = 0x00000003
-)
-
-// MessageBox icon types.
-const (
- MB_ICONEXCLAMATION = 0x00000030
- MB_ICONWARNING = 0x00000030
- MB_ICONINFORMATION = 0x00000040
- MB_ICONASTERISK = 0x00000040
- MB_ICONQUESTION = 0x00000020
- MB_ICONSTOP = 0x00000010
- MB_ICONERROR = 0x00000010
- MB_ICONHAND = 0x00000010
-)
-
-// MessageBox default button types.
-const (
- MB_DEFBUTTON1 = 0x00000000
- MB_DEFBUTTON2 = 0x00000100
- MB_DEFBUTTON3 = 0x00000200
- MB_DEFBUTTON4 = 0x00000300
-)
-
-// MessageBox modality types.
-const (
- MB_APPLMODAL = 0x00000000
- MB_SYSTEMMODAL = 0x00001000
- MB_TASKMODAL = 0x00002000
-)
-
-// MessageBox miscellaneous types.
-const (
- MB_DEFAULT_DESKTOP_ONLY = 0x00020000
- MB_RIGHT = 0x00080000
- MB_RTLREADING = 0x00100000
- MB_SETFOREGROUND = 0x00010000
- MB_TOPMOST = 0x00040000
- MB_SERVICE_NOTIFICATION = 0x00200000
-)
-
-// MessageBox return values.
-const (
- IDABORT = 3
- IDCANCEL = 2
- IDCONTINUE = 11
- IDIGNORE = 5
- IDNO = 7
- IDOK = 1
- IDRETRY = 4
- IDTRYAGAIN = 10
- IDYES = 6
-)
-
-var (
- messageBox = user32.NewProc("MessageBoxW")
-)
-
-func MessageBox(hWnd HWND, lpText string, lpCaption string, uType uint32) (result int, err error) {
- r1, _, err := messageBox.Call(
- uintptr(unsafe.Pointer(hWnd)),
- uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(lpText))),
- uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(lpCaption))),
- uintptr(uType))
- if r1 == 0 { // failure
- return 0, err
- }
- return int(r1), nil
-}