'Copy the text in the region to the windows clipboard.'

def copy_selection_to_clipboard(self):

    if (self.enable_win32_clipboard and self.enable_selection and (self.selection_mark >= 0)):
        selection_mark = min(self.selection_mark, len(self.line_buffer))
        cursor = min(self.point, len(self.line_buffer))
        if (self.selection_mark == (-1)):
            return
        begin = min(cursor, selection_mark)
        end = max(cursor, selection_mark)
        toclipboard = ''.join(self.line_buffer[begin:end])
        clipboard.SetClipboardText(str(toclipboard))
