Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
how do i take a screen shot of the whole screen. if i take a screen shot using sendkeys then i for some reason i only get a picture of my program. Also how can i save it afterwards?
Posted
i did type just print screen and it gave me active window only. on the code Shazbots gave me it says SendKeys.SendWait("{PRTSC 2}"). but i just figured out that active window should work for me. Thank you for your help
  • Leaders
Posted

try the keyboard event api :)

Private Declare Sub keybd_event Lib "user32.dll" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Integer, ByVal dwExtraInfo As Integer)
'/// then in a sub / click event...
       Dim VK_SNAPSHOT As Integer = &H2C
       keybd_event(VK_SNAPSHOT, 0, 0, 0)

Posted

here is code in c#

 

send it 'true' if you only want the active window .. false if you want everything.

private Image GetScreenShot(bool activeWindowOnly)
{
 if(activeWindowOnly)
 {
   SendKeys.SendWait("%{PRTSC}");
 }
 else
 {
   SendKeys.SendWait("{PRTSC 2}");
 }

 return (Bitmap)Clipboard.GetDataObject().GetData(DataFormats.Bitmap);
}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...