diff --git a/prefsize_windows.go b/prefsize_windows.go index 2ee5d51..3dac306 100644 --- a/prefsize_windows.go +++ b/prefsize_windows.go @@ -53,6 +53,10 @@ var stdDlgSizes = [nctypes]dlgunits{ // height is not clearly defined here ("an integral number of items (3 items minimum)") so just use a three-line edit control height: 14 + 10 + 10, }, + c_progressbar: dlgunits{ + width: 237, // the first reference says 107 also works; TODO decide which to use + height: 8, + }, } var ( diff --git a/sysdata_windows.go b/sysdata_windows.go index 7c904ae..cd5d8c8 100644 --- a/sysdata_windows.go +++ b/sysdata_windows.go @@ -37,23 +37,23 @@ const controlstyle = _WS_CHILD | _WS_VISIBLE | _WS_TABSTOP const controlxstyle = 0 var classTypes = [nctypes]*classData{ - c_window: &classData{ + c_window: &classData{ style: _WS_OVERLAPPEDWINDOW, xstyle: 0, }, - c_button: &classData{ + c_button: &classData{ name: "BUTTON", style: _BS_PUSHBUTTON | controlstyle, xstyle: 0 | controlxstyle, font: &controlFont, }, - c_checkbox: &classData{ + c_checkbox: &classData{ name: "BUTTON", style: _BS_AUTOCHECKBOX | controlstyle, xstyle: 0 | controlxstyle, font: &controlFont, }, - c_combobox: &classData{ + c_combobox: &classData{ name: "COMBOBOX", style: _CBS_DROPDOWNLIST | _WS_VSCROLL | controlstyle, xstyle: 0 | controlxstyle, @@ -66,19 +66,19 @@ var classTypes = [nctypes]*classData{ selectedIndexErr: _CB_ERR, addSpaceErr: _CB_ERRSPACE, }, - c_lineedit: &classData{ + c_lineedit: &classData{ name: "EDIT", style: _ES_AUTOHSCROLL | _WS_BORDER | controlstyle, xstyle: 0 | controlxstyle, font: &controlFont, }, - c_label: &classData{ + c_label: &classData{ name: "STATIC", style: _SS_NOPREFIX | controlstyle, xstyle: 0 | controlxstyle, font: &controlFont, }, - c_listbox: &classData{ + c_listbox: &classData{ name: "LISTBOX", // TODO also _WS_HSCROLL? style: _WS_VSCROLL | controlstyle, @@ -92,6 +92,11 @@ var classTypes = [nctypes]*classData{ selectedIndexErr: _LB_ERR, addSpaceErr: _LB_ERRSPACE, }, + c_progressbar: &classData{ + name: XXXXX, + style: _PBS_SMOOTH | controlstyle, + xstyle: 0 | controlxstyle, + }, } func (s *sysData) addChild(child *sysData) _HMENU { @@ -501,3 +506,19 @@ func (s *sysData) delete(index int) (err error) { } return nil } + +func (s *sysData) setProgress(percent int) { + ret := make(chan uiret) + defer close(ret) + uitask <- &uimsg{ + call: _sendMessage, + p: []uintptr{ + uintptr(s.hwnd), + uintptr(_PBM_SETPOS), + uintptr(_WPARAM(percent)), + uintptr(0), + }, + ret: ret, + } + <-ret +}