From 3482c9c541210dbf0e7bdd5dbf2c6372d5d55162 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sun, 9 Feb 2014 14:59:37 -0500 Subject: Added the rest of the skeleton necessary for opening a simple window as well as the code to actually open one. Now for custom window procedures! --- painting.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 painting.go (limited to 'painting.go') diff --git a/painting.go b/painting.go new file mode 100644 index 0000000..069fd2d --- /dev/null +++ b/painting.go @@ -0,0 +1,20 @@ +// 9 february 2014 +package main + +import ( +// "syscall" +// "unsafe" +) + +var ( + updateWindow = user32.NewProc("UpdateWindow") +) + +// TODO is error handling valid here? MSDN just says zero on failure; syscall.LazyProc.Call() always returns non-nil +func UpdateWindow(hWnd HWND) (err error) { + r1, _, err := updateWindow.Call(uintptr(hWnd)) + if r1 == 0 { // failure + return err + } + return nil +} -- cgit v1.2.3