summaryrefslogtreecommitdiff
path: root/stdwndclass_windows.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-02-11 19:18:03 -0500
committerPietro Gagliardi <[email protected]>2014-02-11 19:18:03 -0500
commit73fa611b3726fbb2f6af198e8a0744add75c4e94 (patch)
tree3e83b2725ebc2fefb4c042b427cc556ea0f60947 /stdwndclass_windows.go
parentecb2205e02fa68e3c820d2139f6d735ad799a0c2 (diff)
All build errors resolved. Now to test...
Diffstat (limited to 'stdwndclass_windows.go')
-rw-r--r--stdwndclass_windows.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/stdwndclass_windows.go b/stdwndclass_windows.go
index e3eafa8..14a44aa 100644
--- a/stdwndclass_windows.go
+++ b/stdwndclass_windows.go
@@ -42,7 +42,7 @@ func stdWndProc(hwnd _HWND, uMsg uint32, wParam _WPARAM, lParam _LPARAM) _LRESUL
uintptr(uMsg),
uintptr(wParam),
uintptr(lParam))
- return LRESULT(r1)
+ return _LRESULT(r1)
}
panic(fmt.Sprintf("stdWndProc message %d did not return: internal bug in ui library", uMsg))
}
@@ -66,18 +66,21 @@ func registerStdWndClass() (err error) {
_IDC_ARROW = 32512
)
- icon, err := user32.NewProc("LoadIconW").Call(
+ r1, _, err := user32.NewProc("LoadIconW").Call(
uintptr(_NULL),
uintptr(_IDI_APPLICATION))
if err != nil {
return fmt.Errorf("error getting window icon: %v", err)
}
- cursor, err := user32.NewProc("LoadCursorW").Call(
+ icon := _HANDLE(r1)
+
+ r1, _, err = user32.NewProc("LoadCursorW").Call(
uintptr(_NULL),
uintptr(_IDC_ARROW))
if err != nil {
return fmt.Errorf("error getting window cursor: %v", err)
}
+ cursor := _HANDLE(r1)
wc := &_WNDCLASS{
lpszClassName: syscall.StringToUTF16Ptr(stdWndClass),
@@ -88,7 +91,7 @@ func registerStdWndClass() (err error) {
hbrBackground: _HBRUSH(_COLOR_BTNFACE + 1),
}
- r1, _, err := user32.NewProc("RegisterClassW").Call(uintptr(unsafe.Pointer(wc)))
+ r1, _, err = user32.NewProc("RegisterClassW").Call(uintptr(unsafe.Pointer(wc)))
if r1 == 0 { // failure
return fmt.Errorf("error registering class: %v", err)
}