I wonder how the screen recorder and screen capture application capture the window screen.?
As I know How to take Snapshot in this But the question is that their application were minimize/minimize to notify icons....
And by the one click: (F11) screen get capture...
I tried this.
notifyicon1.show()... etc etc/....
But i could not manage that When i am unfocus to the form then though How I can capture the screen:

My code to capture the Screen are below:

Public Class Snapshoter

    Private Sub Snapshoter_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
        If e.KeyCode = Keys.F11 Then
            Dim bounds As Rectangle
            Dim screenshot As System.Drawing.Bitmap
            Dim graph As Graphics
            bounds = Screen.PrimaryScreen.Bounds
            screenshot = New System.Drawing.Bitmap(bounds.Width, bounds.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb)
            graph = Graphics.FromImage(screenshot)
            graph.CopyFromScreen(bounds.X, bounds.Y, 0, 0, bounds.Size, CopyPixelOperation.SourceCopy)
            PictureBox1.Image = screenshot
            Me.FormBorderStyle = Windows.Forms.FormBorderStyle.Sizable
            Dim ask As MsgBoxResult
            ask = MsgBox("Want to save image?", MsgBoxStyle.Question & MsgBoxStyle.YesNo, "DM.Question")
            If ask = MsgBoxResult.Yes Then
                If ask = MsgBoxResult.No Then
                    PictureBox1.Visible = False
                    PictureBox1.Enabled = False
                End If
            End If
        End If

        If e.KeyCode = Keys.F12 Then
        End If

    End Sub

    Private Sub Snapshoter_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        MsgBox("Hotkeys:" & vbNewLine & "F11: Snapshot" & vbNewLine & "F12: Exit Snapshoter", MsgBoxStyle.OkOnly, "")
    End Sub

    Private Sub SaveFileDialog1_FileOk(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles SaveFileDialog1.FileOk
        Dim FileToSaveAs As String = SaveFileDialog1.FileName
        PictureBox1.Image.Save(SaveFileDialog1.FileName, System.Drawing.Imaging.ImageFormat.Png)
    End Sub
End Class
3 Years
Discussion Span
Last Post by Deep Modi

Use Timer and Keylogger.
Type this below Public class form 1
Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Int32) As Int16

Form1.windwostate must be minimize if not then though it is going to work

Timer Code are Below:

Dim snap As Boolean
snap = GetAsyncKeyState(Keys.F11)
    If snap = True Then
        'Add here the image capture code
    End If
Dim snapexiter As Boolean
snapexiter = GetAsyncKeyState(Keys.F12)
    If snapexiter = True Then
    End If

This will work as I am using same code for this

Votes + Comments
Thanks, I got it
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.