View Full Version: print screen button

C++ Learning Community > Computer Lab > print screen button


Title: print screen button
Description: what ACTUALLY happens?


ih8censorship - September 20, 2003 12:31 AM (GMT)
does anyone knoe what actually happens when you press the print screen button? i tryed to make a program to check if it was pressed and it never seems to work. it works with about any other key just not print screen. my theory is that print screen temporarily freezes the programs(for like a milisecond) to take a screenshot, thats why you never see the cursor in your screenshot. actually what im atempting to make is an anti rip dll for game maker that can check for the print screen button and then do something like make the game quit or blank out the screen before the screenshot is taken , but im finding this to be difficult since i dont know what actually goes on when print screen is pressed.

TheHawgMaster - September 20, 2003 04:01 AM (GMT)
I probably changes, but windows will probably catch this message most of the time before your program does; then I think it goes through a prodecure like the following:
  • Re-directs GDI output to an offscreen buffer
  • Hides the cursor
  • Invalidates the desktop (forcing redraw)
  • Copies the off-screen buffer to clipboard (Or points clipboard to offscreen buffer, or however that works).
I don't see why your program would not be able to get the message after windows deals with it though. Why not just clear the clipboard, the printscreen keystate, and not dispatch your message again whenever you recieve a printscreen message? (I hope that was clear)




* Hosted for free by InvisionFree