borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (header as BM,MZ)Next Topic (Subclassing a command button) New Topic New Poll Post Reply
AndreaVB Forum : API : Hook Programming
Poster Message
Afshin_Zavar
Level: Sage

Registered: 17-07-2003
Posts: 64

icon Hook Programming

Hi all friends
Cause I wanna write "registry monitoring program, so
please give me full information about "writting HOOK programs"


____________________________
Persia

08-02-2004 at 08:15 AM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
siddhs
Level: Professor

Registered: 02-03-2003
Posts: 92
icon Re: Hook Programming

hiiiii
     HOOK ........the toughest to write one in VB.



A hook is a point in the system message-handling mechanism where an application can install a subroutine to monitor the message traffic in the system and process certain types of messages before they reach the target window procedure. To install a hook use SetWindowsHookEx() function. It takes 4 parameters


There are two types of Hooks - Thread specific hooks and Systemwide hooks. A thread specific hook is associated with particular thread only (Any thread owned by the calling process.). If you want to associate the hook with other processes and threads, you will have to use a systemwide hook. There is a hook procedure associated with a hook. This procedure is always called when the particular event occurs. For eg. the mouse. When there is an event associated with the mouse, this hook procedure is called. The hook is set by calling the function SetWindowsHookEx( ). The hook is removed by calling UnhookWindowsHookEx( ).

For thread hooks, the hook procedure may be in an EXE file or a DLL. But for Global or System hooks, the hook procedure must reside in a DLL. For this, we need to create a DLL.

To do this, create a Win32 DLL project with only the starter files in it and modify it to suit your needs. It is better to put the code for installing and removing the hook in the DLL itself.


Just some notes

Siddhs

____________________________
FireFox - Its Yours & Its Free
Here it is

45 Gmail Invities left ;) ....PM me to get one...

25-04-2004 at 07:19 AM
View Profile Send Email to User Show All Posts | Quote Reply
ganabo
Level: Guest

icon Re: Hook Programming

here have samples,
http://www.pudn.com

01-07-2004 at 11:14 PM
| Quote Reply
Afshin_Zavar
Level: Sage

Registered: 17-07-2003
Posts: 64
icon Re: Hook Programming

thanks friends

____________________________
Persia

02-07-2004 at 08:24 AM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
AndreaVB Forum : API : Hook Programming
Previous Topic (header as BM,MZ)Next Topic (Subclassing a command button) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder