diff options
Diffstat (limited to 'stdwndclass_windows.go')
| -rw-r--r-- | stdwndclass_windows.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/stdwndclass_windows.go b/stdwndclass_windows.go index f4004e4..7ec25fb 100644 --- a/stdwndclass_windows.go +++ b/stdwndclass_windows.go @@ -84,6 +84,25 @@ func stdWndProc(hwnd _HWND, uMsg uint32, wParam _WPARAM, lParam _LPARAM) _LRESUL if wParam.HIWORD() == _BN_CLICKED { ss.signal() } + case c_checkbox: + // we opt into doing this ourselves because http://blogs.msdn.com/b/oldnewthing/archive/2014/05/22/10527522.aspx + if wParam.HIWORD() == _BN_CLICKED { + state, _, _ := _sendMessage.Call( + uintptr(ss.hwnd), + uintptr(_BM_GETCHECK), + uintptr(0), + uintptr(0)) + if state == _BST_CHECKED { + state = _BST_UNCHECKED + } else if state == _BST_UNCHECKED { + state = _BST_CHECKED + } + _sendMessage.Call( + uintptr(ss.hwnd), + uintptr(_BM_SETCHECK), + state, // already uintptr + uintptr(0)) + } } return 0 case _WM_GETMINMAXINFO: |
