im habing this problm
the prtscr works, but only when the application is active.
VB Code:
Public Class Form1 Public Declare Function RegisterHotKey Lib "user32" (ByVal hwnd As IntPtr, ByVal id As Integer, ByVal fsModifiers As Integer, ByVal vk As Integer) As Integer Public Declare Function UnregisterHotKey Lib "user32" (ByVal hwnd As IntPtr, ByVal id As Integer) As Integer Public Const WM_HOTKEY As Integer = &H312 Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message) If m.Msg = WM_HOTKEY Then ' Pressed the hotkey! PictureBox1.Image = Clipboard.GetImage() Me.ShowInTaskbar = False Me.WindowState = FormWindowState.Normal End If MyBase.WndProc(m) '<-- Never Ever Forget This! End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Me.ShowInTaskbar = True Me.WindowState = FormWindowState.Minimized RegisterHotKey(Me.Handle, 9, 0, 44) End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click SaveFileDialog1.ShowDialog() PictureBox1.Image.Save(SaveFileDialog1.FileName) End Sub Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing Call UnregisterHotKey(Me.Handle, 9) '<-- Don't forget this End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Call RegisterHotKey(Me.Handle, 9, 0, 44) '<-- Play with these settings End Sub End Class
i have it so it minimizes, you press a key (prntscreen) then it takes the screenshot (using windows) and pastes it in the picture box. it goes back to normal windowed mode when prnt screen is pressed, but it doesnt actually prnt screen. Windows only prntscreens when my app is active. If im not making myself clear tell me and i will clarify
