There is no way to do this exactly the way X does, with the temporary and permanent clipboard, in a way that works with every application.
Selecting text in a standard edit control generates only WM_MOUSEMOVE messages, so we'd have to trigger copying upon that. Copying from a standard edit control into a temporary buffer of our own would probably be possible, but that would not work with browsers, word processors, source code editors and pretty much everything else that is not plain and simple text. So this approach is more trouble than it's worth.
It would also be possible to use the Windows clipboard for copying, by sending it a WM_COPY. That would allow you to copy from every window (even browsers and the like), but would destroy the clipboard contents upon every selection. Very undesirable.
A compromise would be not to do copying at all, and send WM_PASTE upon a middle button click. Not extremely useful, but better than nothing. Would need a blacklist for applications like Blender, browsers, MS Word and such, that use the middle button for other things.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logged In: YES
user_id=1679966
Originator: YES
There is no way to do this exactly the way X does, with the temporary and permanent clipboard, in a way that works with every application.
Selecting text in a standard edit control generates only WM_MOUSEMOVE messages, so we'd have to trigger copying upon that. Copying from a standard edit control into a temporary buffer of our own would probably be possible, but that would not work with browsers, word processors, source code editors and pretty much everything else that is not plain and simple text. So this approach is more trouble than it's worth.
It would also be possible to use the Windows clipboard for copying, by sending it a WM_COPY. That would allow you to copy from every window (even browsers and the like), but would destroy the clipboard contents upon every selection. Very undesirable.
A compromise would be not to do copying at all, and send WM_PASTE upon a middle button click. Not extremely useful, but better than nothing. Would need a blacklist for applications like Blender, browsers, MS Word and such, that use the middle button for other things.