def disable(self): style = win32gui.GetWindowLong(self.handle, win32con.GWL_STYLE) style |= win32con.WS_DISABLED win32gui.SetWindowLong(self.handle, win32con.GWL_STYLE, style) win32gui.SendMessage(self.handle, win32con.WM_ENABLE, 0, 0)
def enable(self): style = win32gui.GetWindowLong(self.handle, win32con.GWL_STYLE) style &= (~win32con.WS_DISABLED) win32gui.SetWindowLong(self.handle, win32con.GWL_STYLE, style) win32gui.SendMessage(self.handle, win32con.WM_ENABLE, 1, 0)
def _show_caret_pos(self): edit = win32gui.GetDlgItem(self.hwnd, IDC_SCRIPT) pos = win32gui.SendMessage(edit, win32con.EM_GETSEL, None, None) self.row = win32api.LOWORD(pos) self.col = win32api.HIWORD(pos) self._set_status_message('%d:%d' % (self.row, self.col))
def _scroll_message(self, hEdit): win32gui.SendMessage(hEdit, win32con.EM_SETSEL, 0, -1) win32gui.SendMessage(hEdit, win32con.EM_SETSEL, -1, -1) win32gui.SendMessage(hEdit, win32con.EM_SCROLLCARET, 0, 0)
def AddButtons(self, *buttons): tbbuttons = '' for button in buttons: tbbuttons += button.toparam() return win32gui.SendMessage(self.hwnd, commctrl.TB_ADDBUTTONS, len(buttons), tbbuttons)
def update_done(self): h = self.update_control.handle style = win32gui.GetWindowLong(h, win32con.GWL_STYLE) style &= (~win32con.WS_DISABLED) win32gui.SetWindowLong(h, win32con.GWL_STYLE, style) win32gui.SendMessage(h, win32con.WM_ENABLE, 1, 0)