Skip to content

Instantly share code, notes, and snippets.

@rdp
Created August 1, 2014 00:22
Show Gist options
  • Save rdp/16c967ac24a6fe0ebf94 to your computer and use it in GitHub Desktop.
Save rdp/16c967ac24a6fe0ebf94 to your computer and use it in GitHub Desktop.
package main
// doesn't work, unfortunately :|
// #include <windows.h>
// #include <psapi.h>
import "C"
import "unsafe"
import "fmt"
import "syscall"
func main() {
//cs := C.CString("Hello from stdio\n")
var MB_YESNOCANCEL = 0x00000003
ret := C.MessageBoxW((*C.struct_HWND__)(unsafe.Pointer(uintptr(0))),
( *C.WCHAR)(unsafe.Pointer(syscall.StringToUTF16Ptr("Done Title"))),
( *C.WCHAR)(unsafe.Pointer(syscall.StringToUTF16Ptr("This test is Done."))),
(C.UINT)(MB_YESNOCANCEL));
fmt.Printf("Return: %d\n", ret)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment