Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print Screen facility in a Delphi Application 5

Status
Not open for further replies.

Stretchwickster

Programmer
Apr 30, 2001
1,746
GB
I recently needed to automate an Alt-PrintScreen key press and, after much digging, found the following single-line does the job very well.

To simulate the ALT-PRINTSCREEN keyboard combination use this line i.e. to capture the active window:
Code:
  keybd_event(VK_SNAPSHOT, 1, 0, 0);

To simulate the PRINTSCREEN keyboard button press use this line i.e. to capture the entire screen:
Code:
  keybd_event(VK_SNAPSHOT, 0, 0, 0);

The Windows unit must be included to use this procedure.
For more info on this check out:

Hope people find this useful! [infinity]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top