summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-04-09 11:13:35 -0400
committerPietro Gagliardi <[email protected]>2014-04-09 11:13:35 -0400
commit49103abe7c927bd05a5dc5d3e7b740d583605dc0 (patch)
tree641f3535a5dfb7e4ff99507ff450867c3fdc8e78
parent67c56c3766c3df15e97b646ab64a26180609e726 (diff)
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).
-rw-r--r--uitask_windows.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/uitask_windows.go b/uitask_windows.go
index 8369e33..ccd411a 100644
--- a/uitask_windows.go
+++ b/uitask_windows.go
@@ -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))