How to use SetWindowLong outside my aplication?

Posted by haivan lovrevic on April 05, 2006

Hi to you all. Before I posted this I tried to search for existing posts about this subject, but with no luck.

When I use GetWindowLong(comhandle,GWL_WNDPROC) on some component that's on my aplication, it gives me what I need.
Also, when I use:
SetWindowLong(comhandle,GWL_WNDPROC,LongInt(@NewWindowProc)), where comhandle is the handler of some component on my aplication, I get NewWindowProc to receive messages sent to that component.

But, if comhandle is the handler of some component on any other aplication (IE, Notepad...) GetWindowLong(comhandle,GWL_WNDPROC) returns 0, and SetWindowLong(comhandle,GWL_WNDPROC,LongInt(@NewWindowProc)) does not work.

My question is how can I intercept messages sent TO and FROM some component in some other aplication if I have it's handler (example IE ComboBox. I get it's handler by using FindWindowEx()).

Thank you very much.

Related Articles and Replies