Results 1 to 19 of 19

Thread: Print SCREEN is Driving me INSANE! HELP!

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2005
    Location
    Miami
    Posts
    26

    Print SCREEN is Driving me INSANE! HELP!

    Ok, so my computer likes to randomelly use the print screen button. Like, whenever it feels like it will just randommely screen capture whatever Im doing. I tried everything from ripping the key off the keyboard (this laptop) to recovering with the system CDs. Its a huge problem because this laptop is slow, and a screen capture during something like a game will usually lag me for 5-10 seconds. and sometimes it does it in row like 15 times at once.


    Anyways, I want to write a short program that I can load and will cause the computer to ignore the print-screen. I tried checking for a keyascii when the button is pressed, but there is none, so that idea is out. Im out of ideas...

  2. #2
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    Re: Print SCREEN is Driving me INSANE! HELP!

    Sounds like a virus to me...

    After the print screen, does anything transfer through internet ?

  3. #3
    Hyperactive Member shizzy's Avatar
    Join Date
    May 2005
    Location
    Michigan
    Posts
    278

    Re: Print SCREEN is Driving me INSANE! HELP!

    Maybe there is a short in the wires for the print screen key? If it is on a laptop, you cant buy another keyboard
    In rare occasion, if I help you, give me some rate points. They help me sleep at night
    WMRR Rockin' the Lakeshore! For all your guitar music needs! For all your guitar purchasing needs!
    AC/DC Rocks! Van Halen! Led Zeppelin!

    my webpage

  4. #4

  5. #5
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: Print SCREEN is Driving me INSANE! HELP!

    Quote Originally Posted by MartinLiss
    that virus is 8 years old, and is sending stuff to the printer. But CVMichael is probably right anyway. But then I guess it is an other virus.


    ØØ

  6. #6
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Print SCREEN is Driving me INSANE! HELP!

    If you want to discard the Print Screen button you'll need a low-level keyboard hook. Copy the following code to a module.
    VB Code:
    1. Private Declare Function SetWindowsHookEx _
    2.  Lib "user32" Alias "SetWindowsHookExA" ( _
    3.  ByVal idHook As Long, _
    4.  ByVal lpfn As Long, _
    5.  ByVal hmod As Long, _
    6.  ByVal dwThreadId As Long) As Long
    7.  
    8. Private Declare Function CallNextHookEx Lib "user32" ( _
    9.  ByVal hHook As Long, _
    10.  ByVal nCode As Long, _
    11.  ByVal wParam As Long, _
    12.  ByVal lParam As Long) As Long
    13.  
    14. Private Declare Function UnhookWindowsHookEx Lib "user32" ( _
    15.  ByVal hHook As Long) As Long
    16.  
    17. Private Declare Sub CopyMemory _
    18.  Lib "kernel32" Alias "RtlMoveMemory" ( _
    19.  pDest As Any, _
    20.  pSource As Any, _
    21.  ByVal cb As Long)
    22.  
    23. Private Type KBDLLHOOKSTRUCT
    24.     vkCode As Long
    25.     scanCode As Long
    26.     flags As Long
    27.     time As Long
    28.     dwExtraInfo As Long
    29. End Type
    30.  
    31. Private Const HC_ACTION = 0
    32. Private Const VK_SNAPSHOT = &H2C
    33. Private Const WH_KEYBOARD_LL = 13&
    34.  
    35. Private hKeyb As Long
    36.  
    37. Public Function KeybCallback(ByVal Code As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
    38.     Static udtHook As KBDLLHOOKSTRUCT
    39.    
    40.     If (Code = HC_ACTION) Then
    41.         'Copy the keyboard data out of the lParam (which is a pointer)
    42.         Call CopyMemory(udtHook, ByVal lParam, Len(udtHook))
    43.         If udtHook.vkCode = VK_SNAPSHOT Then
    44.             KeybCallback = 1
    45.             Exit Function
    46.         End If
    47.     End If
    48.     KeybCallback = CallNextHookEx(hKeyb, Code, wParam, lParam)
    49. End Function
    50.  
    51. Public Sub HookKeyboard()
    52.     UnhookKeyboard
    53.     hKeyb = SetWindowsHookEx(WH_KEYBOARD_LL, AddressOf KeybCallback, App.hInstance, 0&)
    54. End Sub
    55.  
    56. Public Sub UnhookKeyboard()
    57.     If hKeyb <> 0 Then
    58.         Call UnhookWindowsHookEx(hKeyb)
    59.         hKeyb = 0
    60.     End If
    61. End Sub
    In your Form_Load event call the HookKeyboard sub and in Form_Unload call UnhookKeyboard.

  7. #7
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    Re: Print SCREEN is Driving me INSANE! HELP!

    Since the virus is that old, I'm sure that almost any antivirus program will remove it...

    Also... if there was a keyboard problem, the keys around the "print screen" key should (but not neccesarily) be affected also.

    So I'm still more inclined that it is a virus.

  8. #8
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Print SCREEN is Driving me INSANE! HELP!

    That virus effected 16-bit DOS programs but it could of course still be a virus. It could also be a defect keyboard. On one of my older laptops I had a simular problem with the F10 key that constantly caused the menu of the current window to gain focus. Attaching an external keyboard caused the problem to disappear.

  9. #9
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: Print SCREEN is Driving me INSANE! HELP!

    Ohhh...that reminds me. If you have a wireeless keyboard. Try to change your batteries. And check that they have the right V. If you are using rechargable batteries, they are most often 1.2V, but normal AA batteries are 1.5V. That made my keyboard open up the help file and close Fx every now and then before I understood what it was.



    ØØ

  10. #10
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Print SCREEN is Driving me INSANE! HELP!

    Quote Originally Posted by NoteMe
    that virus is 8 years old, and is sending stuff to the printer. But CVMichael is probably right anyway. But then I guess it is an other virus.


    ØØ
    Oops, didn't notice the date.

  11. #11

    Thread Starter
    Junior Member
    Join Date
    May 2005
    Location
    Miami
    Posts
    26

    Re: Print SCREEN is Driving me INSANE! HELP!

    Thank you for all the help guys!

    it doesnt spool to the printer, and It does it even after a complete restore... I was thinking faulty keyboard but even with no key attached it still occurs... Perhaps I should try an external board. I am using the laptop's keyboard, not a wireless.

    In any case, I will try that low-level hook above, but Im a bit confused... I know all I need to do is copy/paste and it should work... and thats GREAT! thank you for the help... BUT I hate just copy/pasting code without knowing what it does, I actually like to learn these things so I can use them in the future without having to bug people on a forum.

    So I guess what im asking is, is there some kind of tutorial that teaches this stuff? I know there is lots of info on the guru website.
    Last edited by Kingtal0n; May 30th, 2005 at 12:48 PM.

  12. #12
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Print SCREEN is Driving me INSANE! HELP!

    The code creates a low-level keyboard hook, which means that the KeybCallback function above will be called first whenever a key is hit. The procedure only checks for the VK_SNAPSHOT key (which is the Print Screen key) and if it is the function returns TRUE (or 1) back to Windows which means that our application has handled the key and no more work should be done. This prevents Windows from taking the snapshot and copy it to the keyboard.

  13. #13
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Print SCREEN is Driving me INSANE! HELP!

    I posted code that clears the clipboard twice a second 12 hours ago. Search for my posts. It may help you.

  14. #14
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Print SCREEN is Driving me INSANE! HELP!

    Quote Originally Posted by dglienna
    I posted code that clears the clipboard twice a second 12 hours ago. Search for my posts. It may help you.
    I don't think it's the fact that the image is on the clipboard but rather that it takes time to put it there.

  15. #15

    Thread Starter
    Junior Member
    Join Date
    May 2005
    Location
    Miami
    Posts
    26

    Re: Print SCREEN is Driving me INSANE! HELP!

    Well guys it works great, thanks again, i found this article today: http://www.developer.com/net/vb/article.php/1502401

    And it seems to be about what we are doing here, so I will read up on this technique. Thanks again for all the help! and the super-fast posting... Other forums (freshalloy.com, thirdgen.org) that I post on take Wayyyy longer to get help.

  16. #16
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Print SCREEN is Driving me INSANE! HELP!

    Yeah, that article is using the same basic code as I posted earlier above.

  17. #17
    New Member
    Join Date
    Jun 2005
    Posts
    1

    Re: Print SCREEN is Driving me INSANE! HELP!

    Quote Originally Posted by Joacim Andersson
    If you want to discard the Print Screen button you'll need a low-level keyboard hook. Copy the following code to a module.
    VB Code:
    1. Private Declare Function SetWindowsHookEx _
    2.  Lib "user32" Alias "SetWindowsHookExA" ( _
    3.  ByVal idHook As Long, _
    4.  ByVal lpfn As Long, _
    5.  ByVal hmod As Long, _
    6.  ByVal dwThreadId As Long) As Long
    7.  
    8. Private Declare Function CallNextHookEx Lib "user32" ( _
    9.  ByVal hHook As Long, _
    10.  ByVal nCode As Long, _
    11.  ByVal wParam As Long, _
    12.  ByVal lParam As Long) As Long
    13.  
    14. Private Declare Function UnhookWindowsHookEx Lib "user32" ( _
    15.  ByVal hHook As Long) As Long
    16.  
    17. Private Declare Sub CopyMemory _
    18.  Lib "kernel32" Alias "RtlMoveMemory" ( _
    19.  pDest As Any, _
    20.  pSource As Any, _
    21.  ByVal cb As Long)
    22.  
    23. Private Type KBDLLHOOKSTRUCT
    24.     vkCode As Long
    25.     scanCode As Long
    26.     flags As Long
    27.     time As Long
    28.     dwExtraInfo As Long
    29. End Type
    30.  
    31. Private Const HC_ACTION = 0
    32. Private Const VK_SNAPSHOT = &H2C
    33. Private Const WH_KEYBOARD_LL = 13&
    34.  
    35. Private hKeyb As Long
    36.  
    37. Public Function KeybCallback(ByVal Code As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
    38.     Static udtHook As KBDLLHOOKSTRUCT
    39.    
    40.     If (Code = HC_ACTION) Then
    41.         'Copy the keyboard data out of the lParam (which is a pointer)
    42.         Call CopyMemory(udtHook, ByVal lParam, Len(udtHook))
    43.         If udtHook.vkCode = VK_SNAPSHOT Then
    44.             KeybCallback = 1
    45.             Exit Function
    46.         End If
    47.     End If
    48.     KeybCallback = CallNextHookEx(hKeyb, Code, wParam, lParam)
    49. End Function
    50.  
    51. Public Sub HookKeyboard()
    52.     UnhookKeyboard
    53.     hKeyb = SetWindowsHookEx(WH_KEYBOARD_LL, AddressOf KeybCallback, App.hInstance, 0&)
    54. End Sub
    55.  
    56. Public Sub UnhookKeyboard()
    57.     If hKeyb <> 0 Then
    58.         Call UnhookWindowsHookEx(hKeyb)
    59.         hKeyb = 0
    60.     End If
    61. End Sub
    In your Form_Load event call the HookKeyboard sub and in Form_Unload call UnhookKeyboard.
    -----------
    Joacim, many thanks for your post. I'm pretty sure the problem you were responding to is caused by a h/w fault, not malware; I've reloaded XP & 2K on a similarly afflicted HP laptop, no help (the printscreens actually occur during the install- you can tell from the mouse image).

    The printscreens kill any possibility of using Copy-Paste functions. I was researching a replacement for the PC when I stumbled across API solution you posted. If your ever in Leamington Spa, I'll buy you a pint or two. Thanks again.

  18. #18
    New Member
    Join Date
    Jun 2009
    Posts
    1

    Re: Print SCREEN is Driving me INSANE! HELP!

    Hi, I'm having this exact same problem- my clipboard just fills up uncontrollably with screen prints rendering copy/paste unusable. A couple things I've noticed: it seems like the uncontrolled screen captures begin when I copy and paste one thing, and the "end" key temporarily stops the captures (sometimes it will start up again moments later though). Also, the problems started when I was doing a massive amount of copying/pasting (I was putting together a 200 page Word doc). I don't know crap about programming so I probably don't have vb on my laptop (wouldn't know even if I did). Can I still disable screencaptures somehow? Sorry to be thick. Thanks for any help!

  19. #19
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: Print SCREEN is Driving me INSANE! HELP!

    you may be able to disable the clipboard. Anyway, i would like to see the OP hook an external keyboard to his laptop and then disable through hardware settings the onboard keyboard. This will either confirm or not a hardware issue.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

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