473,327 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

What is a hook

Can someone explain to me what a hook is?

Does it has something to do with a debugger?

Thanks
Jul 19 '05 #1
5 19032
Hi,
"Mohammad" <mj*******@hotmail.com> wrote in message
news:3d**************************@posting.google.c om...
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.

Thanks


Regards, Ron AF Greve.
Jul 19 '05 #2
A hook generally a code stub left in the code to support a future
enhancement.

In general the so called design hooks end up cluttering the code. Checkout
the following article:
http://www.eventhelix.com/RealtimeMa...epItSimple.htm

Sandeep
--
http://www.EventHelix.com/EventStudio
EventStudio 2.0 - Generate Sequence Diagrams and Use Case Diagrams in PDF
Jul 19 '05 #3
ev********@hotmail.com (EventHelix.com) wrote in message news:<56**************************@posting.google. com>...
A hook generally a code stub left in the code to support a future
enhancement.

In general the so called design hooks end up cluttering the code. Checkout
the following article:
http://www.eventhelix.com/RealtimeMa...epItSimple.htm

Sandeep


Is there a standard method of creating a hook, e.g., using a function pointer?

How is call to a function is intercepted but the hook function?

Can someone give a snippet of code?

Thanks
Jul 19 '05 #4
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
--
http://www.EventHelix.com/EventStudio
EventStudio 2.0 - Generate Sequence Diagrams and Use Case Diagrams in PDF
Jul 19 '05 #5
Mohammad wrote:
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

--
--- remove zees if contacting via email ---

Jul 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Hans Kiehn | last post by:
Hi *, I'm debugging a crash in a very big and complex server application. This server run's fine for days and hours and suddenly crashes. I've spent 2 weeks of time now, but cannot find the...
5
by: Arnold | last post by:
Hi, I want to make a Global CBT Hook, but the CallBack Method is never raised. SetWindowsHookEx return me a Handle to the Hook, but when i try to uninstall the hook the UnhookWindowsHookEx...
1
by: murlbrown | last post by:
Basicly im trying to determine when a new line has been appended to the textbox of another application. Using spy++ I see that the msg (wm_user + 97) is being sent, which is the EM_SETTEXTEX...
0
by: gekoscan | last post by:
Hello, http://msdn.microsoft.com/msdnmag/issues/02/10/cuttingedge/ I don't know if any of you are familiar with Dino Esposito article in MSDN magazine on .NET Hooks but I used the class he...
7
by: jpierson | last post by:
Hi, I am tryin to create a keyboard hook that sends the keystroke ctrl + pause/break. I haven't used keyboard hooks before so I'm not too sure how to use them public int MyKeyboardProc(int...
2
by: Lunchtimemama | last post by:
I am trying to modify another application's window (Google Talk) to insert some UI of my own. I think the best method would be to install a remote local hook in gtalk's thread that intercepts the...
2
by: bizcor | last post by:
Is it possible to do a local keyboard hook to a process running in a new thread. The process is a command line application and is instanciated when a button is pressed on the main form. I have had...
22
by: schneider | last post by:
I need to hook the system mouse down event. I'm trying to replicate how a context menu hides when the mouse clicks outside of the control. Thanks, Schneider
3
by: rajkpy | last post by:
Please note: I am urgently in need of a solution to this question, for that i have posted this question in different forums so that i can get an answer as quickly as possibly. Please accept my...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.