Results 1 to 2 of 2

Thread: [2005] PrtScr Problem

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2006
    Posts
    108

    [2005] PrtScr Problem

    im habing this problm

    the prtscr works, but only when the application is active.

    VB Code:
    1. Public Class Form1
    2.     Public Declare Function RegisterHotKey Lib "user32" (ByVal hwnd As IntPtr, ByVal id As Integer, ByVal fsModifiers As Integer, ByVal vk As Integer) As Integer
    3.     Public Declare Function UnregisterHotKey Lib "user32" (ByVal hwnd As IntPtr, ByVal id As Integer) As Integer
    4.     Public Const WM_HOTKEY As Integer = &H312
    5.  
    6.     Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
    7.         If m.Msg = WM_HOTKEY Then
    8.             ' Pressed the hotkey!
    9.             PictureBox1.Image = Clipboard.GetImage()
    10.             Me.ShowInTaskbar = False
    11.             Me.WindowState = FormWindowState.Normal
    12.  
    13.         End If
    14.         MyBase.WndProc(m) '<-- Never Ever Forget This!
    15.     End Sub
    16.  
    17.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    18.  
    19.         Me.ShowInTaskbar = True
    20.         Me.WindowState = FormWindowState.Minimized
    21.         RegisterHotKey(Me.Handle, 9, 0, 44)
    22.  
    23.     End Sub
    24.  
    25.     Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    26.  
    27.         SaveFileDialog1.ShowDialog()
    28.         PictureBox1.Image.Save(SaveFileDialog1.FileName)
    29.     End Sub
    30.  
    31.  
    32.     Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
    33.         Call UnregisterHotKey(Me.Handle, 9) '<-- Don't forget this
    34.     End Sub
    35.  
    36.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    37.         Call RegisterHotKey(Me.Handle, 9, 0, 44) '<-- Play with these settings
    38.     End Sub
    39. 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

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Nov 2006
    Posts
    108

    Re: [2005] PrtScr Problem

    its a very strange problem

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width