python - How to append an "checkbox" into dialog by using pywin32 -
i met problem here.
create dialog , add button code below,
because know constant "128" control "button" exsiting example
not know 1 can used "checkbox" or "radiobutton"?
import win32ui import win32api import win32con pywin.mfc import dialog # window frame , title dlg = [ [title, (0, 0, 300, 392), style, none, (8, "ms sans serif")], ] dlg.append([128, u"output", idc_btn_output, (142,56,50,14), win32con.bs_defpushbutton])
according source code , documentation, dialog template here list first item pydlgtemplate
instance followed series of pydlgitemtemplate
instances.
the documentation says first member of pydlgitemtempalte
structure:
[0] string/int : windowclass
the window class. if not string, must in integer defining 1 of built-in windows controls. if string, must pre-registered windows class name, built-in class, or clsid of ole controls. built-in classes include:
control type string class name check box button combo box combobox command button button header sysheader32 label static list box listbox syslistview32 option button button tab systabcontrol32 text box edit richedit tool bar toolbarwindow32 tool tips tooltips_class32 tooltips_class tree view systreeview32
the built-in windows controls are:
integer value window type 0x0080 button 0x0081 edit 0x0082 static 0x0083 list box 0x0084 scroll bar 0x0085 combo box
so while could use integer constant 0x85 (or 133 decimal), i'd strongly recommend use string class name 'combobox'
instead. these string names are, unsurprisingly, same built-in windows class names documented on msdn.
Comments
Post a Comment