As it turns out, Windows does have a facility for windows that only serve as message dispatches; let's use it for our message handler. (I only found this out while looking up SetParent() for the previous commit).
This commit is contained in:
parent
67c56c3766
commit
49103abe7c
|
@ -135,6 +135,11 @@ const (
|
|||
msghandlerclass = "gomsghandler"
|
||||
)
|
||||
|
||||
var (
|
||||
// fron winuser.h; var because Go won't let me
|
||||
_HWND_MESSAGE = -3
|
||||
)
|
||||
|
||||
func makeMessageHandler() (hwnd _HWND, err error) {
|
||||
wc := &_WNDCLASS{
|
||||
lpszClassName: uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(msghandlerclass))),
|
||||
|
@ -159,7 +164,7 @@ func makeMessageHandler() (hwnd _HWND, err error) {
|
|||
uintptr(_CW_USEDEFAULT),
|
||||
uintptr(_CW_USEDEFAULT),
|
||||
uintptr(_CW_USEDEFAULT),
|
||||
uintptr(_NULL),
|
||||
uintptr(_HWND_MESSAGE),
|
||||
uintptr(_NULL),
|
||||
uintptr(hInstance),
|
||||
uintptr(_NULL))
|
||||
|
|
Loading…
Reference in New Issue