elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Estamos en la red social de Mastodon


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  .NET (C#, VB.NET, ASP)
| | | |-+  Programación Visual Basic (Moderadores: LeandroA, seba123neo)
| | | | |-+  una pregunta sobre hooks..
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: una pregunta sobre hooks..  (Leído 962 veces)
ricardovinzo

Desconectado Desconectado

Mensajes: 135


P.T.C


Ver Perfil
una pregunta sobre hooks..
« en: 26 Noviembre 2008, 23:03 pm »

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

cual es la diferencia entre SubClassing y los Hooks??


En línea

3# Convocacion de Moderadores en Code Makers, entra!
cobein


Desconectado Desconectado

Mensajes: 759



Ver Perfil WWW
Re: una pregunta sobre hooks..
« Respuesta #1 en: 29 Noviembre 2008, 07:46 am »

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!


En línea

http://www.advancevb.com.ar
Más Argentino que el morcipan
Aguante el Uvita tinto, Tigre, Ford y seba123neo
Karcrack es un capo.
Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines