diff options
| author | Pietro Gagliardi <[email protected]> | 2014-05-30 17:59:29 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-05-30 17:59:29 -0400 |
| commit | 4a66f1467bf0ee9a69c0758a53ab6f1425da166d (patch) | |
| tree | f11a897c449cc7634c229e00db0d41a37ba8808d /sysdata_windows.go | |
| parent | c543f5639b121bcdae11f681466c030394902f65 (diff) | |
Moved the standard window class (for Window) on Windows to get the sysData pointer from CreateWindowEx() and store it in the window memory instead of being given it via a closure. This will lead to having only one window class for all Windows, which will come next. Also fixed an error in windowsconstgen's output related to GetWindowLongPtr()/SetWindowLongPtr().
Diffstat (limited to 'sysdata_windows.go')
| -rw-r--r-- | sysdata_windows.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sysdata_windows.go b/sysdata_windows.go index b9df277..f813de3 100644 --- a/sysdata_windows.go +++ b/sysdata_windows.go @@ -30,6 +30,7 @@ type classData struct { xstyle uint32 mkid bool altStyle uint32 + storeSysData bool doNotLoadFont bool appendMsg uintptr insertBeforeMsg uintptr @@ -48,6 +49,7 @@ var classTypes = [nctypes]*classData{ register: registerStdWndClass, style: _WS_OVERLAPPEDWINDOW, xstyle: 0, + storeSysData: true, doNotLoadFont: true, }, c_button: &classData{ @@ -157,6 +159,10 @@ func (s *sysData) make(window *sysData) (err error) { if s.alternate { style = uintptr(ct.altStyle) } + lpParam := uintptr(_NULL) + if ct.storeSysData { + lpParam = uintptr(unsafe.Pointer(s)) + } uitask <- &uimsg{ call: _createWindowEx, p: []uintptr{ @@ -171,7 +177,7 @@ func (s *sysData) make(window *sysData) (err error) { pwin, uintptr(cid), uintptr(hInstance), - uintptr(_NULL), + lpParam, }, ret: ret, } |
