I can not catch: the first of these events; The second one seems to be catching, but there is not always a screenshot in the buffer.

Prompt or give an example.

  • in a separate thread, you must call GetKeyboardState and check what is pressed. - Stack

1 answer 1

The problem is that the screenshot in the clipboard is formed for a reason - and the same program that catches these key combinations and puts the screenshot there. Therefore, it is not the best idea to keep track of pressing this key combination and wait for a screenshot in the buffer.

There are two possible normal solutions.

First, you can take a screenshot yourself, this function will help CopyFromScreen

Secondly, you can watch the clipboard and wait for the picture to appear there. To do this, you need the WINAPI function AddClipboardFormatListener

  • Thanks for the tip. I dug up something on this topic, but I don’t quite understand how to use it in my application. Can you help ? - Doublench