Question about win32 hooks.

Hello ,
I did a program that capture the picture from the clipboard(if there is one)
and saves it into a BMP file.

I want to do now that my program will do it when I press print screen for example
now, I know that I need to read on win32 hooks,
But there is so much information on it,
and I don't think I need all the information on win32 hooks...

Humm,,
Anyone can give me a specific information on which hook I need or something?

or if somebody did something like that before and can write something that will help me , I will be grateful


thanks for the helpers.
Last edited on
Wrong forum.

No need for hooks. You just need to
1) add your window to the clipboard viewer chain (with SetClipboardViewer()),
2) process the WM_CHANGECBCHAIN and WM_DRAWCLIPBOARD messages, and
3) remove your window from the clipboard viewer chain before it is destroyed (with ChangeClipboardChain()).

Here is an example, with nearby links to documentation.
http://msdn.microsoft.com/en-us/library/ms649016(VS.85).aspx#_win32_Adding_a_Window_to_the_Clipboard_Viewer_Chain

Hope this helps.
but where is the part that I catch when the user presses print screen for example?
Pressing [PrtScr] automatically posts the captured image to the clipboard. If you are a clipboard viewer, you will be notified of the change.
Topic archived. No new replies allowed.