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

def copy_region_to_clipboard(self, e):

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