una pregunta sobre hooks..

Iniciado por ricardovinzo, 26 Noviembre 2008, 23:03 PM

0 Miembros y 1 Visitante están viendo este tema.

ricardovinzo

Buenas, bueno estuvel leyendo acerca de estos objetos.. pero no me queda algo claro..

cual es la diferencia entre SubClassing y los Hooks??
3# Convocacion de Moderadores en Code Makers, entra!

cobein

http://www.vbaccelerator.com

1. Hooks Compared to Sub-Classing

Essentially a Windows Hook is like a subclass except it applies at the next point up in the message chain. In Win32, messages are queued and sent to the appropriate window via the WindowProc function. A subclass can intercept messages by replacing the existing WindowProc function with a new one.

With a Hook, you get to see all messages before Windows has decided which WindowProc procedure to direct the message to. You can modify or discard most messages at this point too. So using the Hook technique you not only get to act on messages at the highest point; you can also get at messages regardless of which window the message is intended for. This is very useful if you want to process Keyboard or Mouse messages on a global basis in your application, because these messages are normally directed to the window with the focus. If you tried to do the same thing using Subclassing then you would have to subclass every single window handle in your application to follow the mouse events. Using a Hook, the process is simple!
http://www.advancevb.com.ar
Más Argentino que el morcipan
Aguante el Uvita tinto, Tigre, Ford y seba123neo
Karcrack es un capo.