summaryrefslogtreecommitdiff
path: root/uitask_windows.go
blob: 8fe705cc90300463d165416a19840edfc36e60d2 (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
// 11 february 2014
//package ui
package main

import (
	"syscall"
	"unsafe"
	"runtime"
)

var uitask chan *uimsg

type uimsg struct {
	call		*syscall.LazyProc
	p		[]uintptr
	ret		chan uiret
}

type uiret struct {
	ret		uintptr
	err		error
}

func ui(initDone chan error) {
	runtime.LockOSThread()

	uitask = make(chan *uimsg)
	initDone <- doWindowsInit()

	for m := range uitask {
		r1, _, err := m.msg.Call(m.p...)
		m.ret <- uiret{
			ret:	r1,
			err:	err,
		}
	}
}