davejohnston83
October 10th, 2005, 06:18 AM
I keep hearing the term hooks, used in software, and I was wondering if someone could explain the concept behind hooks to me?
|
Click to See Complete Forum and Search --> : What are Hooks in software terms davejohnston83 October 10th, 2005, 06:18 AM I keep hearing the term hooks, used in software, and I was wondering if someone could explain the concept behind hooks to me? golanshahar October 10th, 2005, 06:30 AM under windows OS you can read here: Hooks (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/hooks.asp) Cheers gstercken October 10th, 2005, 06:33 AM I keep hearing the term hooks, used in software, and I was wondering if someone could explain the concept behind hooks to me?In few words: Generally, hooks are predefined points in the execution flow of a system into which you can "hook" your own processing. This is usually done by providing a way for you to supply callback function pointers (C) or by means of virtual functions you can implement (C++). As an example under Windows: Normally, all user actions (mouse clicks, keyboard input) are handled by the system and dispatched to the affected windows, where they arrive in the form of messages. However, Windows provides a way for application programmers to hook into this procedure (via the SetWindowsHookEx API): It allows you to provide a pointer to a callback function which is called each time the system is about to process a mouse message, and gives you a chance to see, handle, change or suppress that message before application windows (or other clients in the hooking chain) get to see them. davejohnston83 October 10th, 2005, 06:58 AM Thats great guys, thanks - another question cleared up. codeguru.com
Copyright Internet.com Inc., All Rights Reserved. |