tags:

views:

23

answers:

1

I've seen the concept out there, but how are they implemented? are they related only to operating system messages and system calls? i was thinking about event handling in GUI applications, detecting and handling the event itself and doing something is considered hooking?

+1  A: 

Handling events in a GUI application is not generally considered "hooking". Rather, that is simply "event handling" within the context of whatever GUI framework you're using.

A "hook" usually refers to something that happens outside the normal flow of control within a system. As a simplified example, a PC firewall application might want to "hook" the socket() call to intercept all attempts by applications to create network sockets, and allow or deny the request as appropriate. The application itself is not usually aware of this extra processing.

Greg Hewgill
if it is out of the normal control flow, are hooks commonly used as separate threads or they're hosted on the application main thread? it i just thought if this because of the extra processing awareness.
jgemedina
an handle to an ajax request for example, or maybe when pushing content somehow to a device or web applciation, could this be similar examples?
jgemedina
It's just terminology; usually a "process hook" refers to something specific depending on the platform you're using. "Pushing content to a device" is far too general to be called a "process hook".
Greg Hewgill
well yeah, i really meant the routine handling and processing the pushed content and doing sth with it, sorry!
jgemedina