Print screen botton

Electronics Computer Programming Q&A
Post Reply
Michael-love-electronics
Posts: 84
Joined: Tue Nov 26, 2002 1:01 am
Contact:

Print screen botton

Post by Michael-love-electronics »

Hi,..<p>Does anyone know what is the code of the "print screen" botton using visual basic.??<p>i.e. How can I make the PC itself presses the "print screen" botton every certain interval.<p>Does anyone know the Keycode of the print screen botton.?????<p>Thanks for all your help :)<p>[ June 24, 2003: Message edited by: Michael Wahid ]</p>
greg123
Posts: 361
Joined: Sat Sep 07, 2002 1:01 am
Location: St. John's NFLD Canada
Contact:

Re: Print screen botton

Post by greg123 »

Sorry Mike, Its taken me a while to come up eith it. Just copy and paste the code and run the program. It will copy the screen at your given interval. Just be sure to specify the interval, it is in miliseconds so 1000 ms = 1 sec.<p>Code:<p>Option Explicit<p>Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Const VK_MENU = &H12
Private Const VK_SNAPSHOT = &H2C
Private Const KEYEVENTF_KEYUP = &H2<p>Private Sub Timer1_Timer()
' capture the whole screen
timer1.Interval =
keybd_event VK_SNAPSHOT, 0, 0, 0
keybd_event VK_SNAPSHOT, 0, KEYEVENTF_KEYUP, 0
End Sub<p>
Thats it.<p>Have fun<p>greg
Michael-love-electronics
Posts: 84
Joined: Tue Nov 26, 2002 1:01 am
Contact:

Re: Print screen botton

Post by Michael-love-electronics »

THANKS VERY MUCH GREG, IT WORKS PERFECT. :) <p> :D
greg123
Posts: 361
Joined: Sat Sep 07, 2002 1:01 am
Location: St. John's NFLD Canada
Contact:

Re: Print screen botton

Post by greg123 »

No trouble.
Post Reply

Who is online

Users browsing this forum: No registered users and 35 guests