summaryrefslogtreecommitdiff
path: root/sysdata_windows.go
diff options
context:
space:
mode:
Diffstat (limited to 'sysdata_windows.go')
-rw-r--r--sysdata_windows.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/sysdata_windows.go b/sysdata_windows.go
index fc6b8c8..ab65879 100644
--- a/sysdata_windows.go
+++ b/sysdata_windows.go
@@ -30,7 +30,6 @@ const controlxstyle = 0
var classTypes = [nctypes]*classData{
c_window: &classData{
- name: stdWndClass,
style: _WS_OVERLAPPEDWINDOW,
xstyle: 0,
},
@@ -59,17 +58,24 @@ func (s *sysData) make(initText string, initWidth int, initHeight int, window *s
ret := make(chan uiret)
defer close(ret)
ct := classTypes[s.ctype]
+ classname := ct.name
cid := _HMENU(0)
pwin := uintptr(_NULL)
if window != nil { // this is a child control
cid = window.addChild(s)
pwin = uintptr(window.hwnd)
+ } else { // need a new class
+ n, err := registerStdWndClass(s)
+ if err != nil {
+ return r.err
+ }
+ classname = n
}
uitask <- &uimsg{
call: _createWindowEx,
p: []uintptr{
uintptr(ct.xstyle),
- uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(ct.name))),
+ uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(classname))),
uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(initText))),
uintptr(ct.style),
uintptr(_CW_USEDEFAULT), // TODO