Make a PrintScreen by code  

Send By: labgalia
Web : N.A.
Email: N.A.
Date: 24/05/20

Tip accessed 1203 times

 



Tip useful for make a screenshot of the current Windows screen content or just the current active window content to the Windows ClipBoard.
Later, we can paste the image in our application, by example, using the tip:

[146] - Paste the Clipboard's image into a TImage

The tip consists in simulate the 'Print Screen" key with a call to Keybd_event Windows Api function.

For capture the full Windows screen:



 keybd_event(vk_snapshot,0, 0, 0);



For Capture just the current active Window:



 keybd_event(vk_snapshot,1, 0, 0);