Reading Windows / System Messages

Hey first of all my knowledge of c++ is extremely limited to just playing around when bored but I wanted to know how difficult something like this might be.

If I have the handle of a window and I'm reading the messages being sent on spy++ , I have narrowed down a few different messages that happen on different events, so for example I know if x event happens the system messaged use is y.

How difficult is it to scan/use those messages, I simply want to say if HWND z receives y message, then do this....

I know it looks simple when I write it like that but I am worried that I might have to use DLL injection or some other method way above my head, Is there a simple way to use/read windows messages to hwnd's?

Cheers,

Ben.
Why not just look at the spy++ source code?
You should be able to accomplish the with the SetWindowsHookEx() function. You don't need code injection unless you plan to execute code inside the process receiving the messages.
@ KBW because I am still learning and I only know the basics so looking at that wall of text would be of no use, I am not good enough to understand whats going on there :)

@ KNN , perfect! would you be able to provide a basic example of a defined HWND listening for a basic windows message can be calculator or paint etc? If you dont want to or dont have time then I understand. Me asking is not through lazyness I just am not good enough to write that kind of code yet, I cant even make proper sense of MSDN documentation lol.

Cheers!
Topic archived. No new replies allowed.