What is a hook

M

Mohammad

Can someone explain to me what a hook is?

Does it has something to do with a debugger?

Thanks
 
M

Moonlit

Hi,


Mohammad said:
Can someone explain to me what a hook is?
A hook is a function that is executed somewhere in between or before another
function. For instance in windows you can place a hook (function) which will
receive all mouse movements. One can use this to create macro's. (I did
something like this in my free frachunt program). I redirected all mouse
messages to my function first (and forwarded them to the function that
originally would receive them) so I could 'replay' them later when the user
asked for it.
Does it has something to do with a debugger?

It has nothing to do with a debugger.

Regards, Ron AF Greve.
 
E

EventHelix.com

Hook is a general term to refer to any code written in the name
for future enhancement. That's all there is to it.

Sandeep
 
J

John Gabriele

Mohammad said:
Can someone explain to me what a hook is?

Does it has something to do with a debugger?

Thanks

I always thought that a "hook function" was some function that the
system/library/toolkit you are working with calls for you in an event-
driven setup.

Consider a GUI toolkit: a View::mouseDown() member function gets called
by the system for you when the user clicks the mouse in some given View.
You inherit from View and implement your own mouseDown(), but you never
explicitly call it yourself. It's a "hook" into the GUI toolkit, provided
for you by the designers of the toolkit.

---J
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top