2014-02-07 20:17:24 -06:00
|
|
|
// 7 february 2014
|
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"syscall"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
user32 = syscall.NewLazyDLL("user32.dll")
|
2014-02-08 22:51:11 -06:00
|
|
|
kernel32 = syscall.NewLazyDLL("kernel32.dll")
|
2014-02-07 20:17:24 -06:00
|
|
|
)
|
|
|
|
|
2014-02-08 22:51:11 -06:00
|
|
|
type HANDLE uintptr
|
|
|
|
type HWND HANDLE
|
|
|
|
type HBRUSH HANDLE
|
2014-02-10 03:59:39 -06:00
|
|
|
type HMENU HANDLE
|
2014-02-07 20:17:24 -06:00
|
|
|
|
|
|
|
const (
|
|
|
|
NULL = 0
|
|
|
|
)
|
|
|
|
|
2014-02-08 22:51:11 -06:00
|
|
|
type ATOM uint16
|
|
|
|
|
|
|
|
// TODO pull the thanks for these three from the old wingo source
|
|
|
|
type WPARAM uintptr
|
|
|
|
type LPARAM uintptr
|
|
|
|
type LRESULT uintptr
|
|
|
|
|
2014-02-10 03:59:39 -06:00
|
|
|
func (w WPARAM) LOWORD() uint16 {
|
|
|
|
// according to windef.h
|
|
|
|
return uint16(w & 0xFFFF)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (w WPARAM) HIWORD() uint16 {
|
|
|
|
// according to windef.h
|
|
|
|
return uint16((w >> 16) & 0xFFFF)
|
|
|
|
}
|
|
|
|
|
2014-02-08 22:51:11 -06:00
|
|
|
// microsoft's header files do this
|
|
|
|
func MAKEINTRESOURCE(what uint16) uintptr {
|
|
|
|
return uintptr(what)
|
|
|
|
}
|