summaryrefslogtreecommitdiff
path: root/common.go
blob: 4505397fdb7f0d930ce4bad2b0c5806ef21c84a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// 7 february 2014
package main

import (
	"syscall"
)

var (
	user32 = syscall.NewLazyDLL("user32.dll")
	kernel32 = syscall.NewLazyDLL("kernel32.dll")
)

type HANDLE uintptr
type HWND HANDLE
type HBRUSH HANDLE
type HMENU HANDLE

const (
	NULL = 0
)

type ATOM uint16

// TODO pull the thanks for these three from the old wingo source
// TODO put these in windows.go
type WPARAM uintptr
type LPARAM uintptr
type LRESULT uintptr

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)
}

// microsoft's header files do this
func MAKEINTRESOURCE(what uint16) uintptr {
	return uintptr(what)
}