1

We can select and copy from the cmd window using the mouse pointer. Suppose I have a program which fills the window with random text and then I select any text using the mouse(I dont copy it just select it), then store that portion of text in a string. So how to do this in C++?

I have done this for selections made using keyboard. But I dont have any idea how to do the same using the mouse pointer.

Its not using any clipboards since nothing was copied to clipboard, I want to copy from buffer to a variable.

Subham Burnwal
  • 310
  • 2
  • 17
  • 2
    Maybe [SetConsoleMode()](https://learn.microsoft.com/en-us/windows/console/setconsolemode) (look at `ENABLE_MOUSE_INPUT`) and [ReadConsoleInput()](https://learn.microsoft.com/en-us/windows/console/reading-input-buffer-events)? – user3366592 Jul 05 '18 at 23:10
  • 1
    This might be of interest. https://stackoverflow.com/questions/9368326/c-win32-text-selection-detection-and-fetching-and-modifying-in-another-applica – lit Jul 06 '18 at 13:14

0 Answers0