How to retrieve the selected text from the active window
问题 I am trying to create a simple open source utility for windows using Python that can perform user-defined actions on the selected text of the currently active window. The utility should be activated using a pre-defined keyboard shortcut. Usage is partially outlined in the following example: The user selects some text using the mouse or the keyboard (in any application window) The user presses a pre-defined keyboard shortcut The selected text is retrieved by our utility or copied to clipboard