Click to See Complete Forum and Search --> : Emulating PrintScreen key


Maxim Zaytsev
August 21st, 1999, 04:04 AM
I wont save image of screen by using Clipboard.
How can I emulate PrintScreen-key pressing ? (keybd_event(VK_SNAPSHOT,0,0,0) not fit. It save in Clipboard only current Form.)
Or there are another way to save Screen image?

August 21st, 1999, 08:40 PM
Use the GetDesktopWindow API to get the hWnd of the screen.
Use the GetDC API to get the hDC of the screen.
Use the BitBlt API with SRCCOPY to copy the screen to a PictureBox.
Use the ReleaseDC API to free memory allocated to the GetDC API you used earlier.
Then copy the PictureBox's contents to the Clipboard using Clipboard.SetData.