Link to home
Start Free TrialLog in
Avatar of ViperX
ViperX

asked on

Hooking

How would I be able to hook a window to recieve its messages without having to buy and expencive control?
Avatar of MikeP090797
MikeP090797

Do you want to hook your own form, or another app's window?
maybe you want to subclass it. Read an example of AddressOf VB operator.
You should use SetWindowsHookEx() and UnhookWindowsEx()
ASKER CERTIFIED SOLUTION
Avatar of VBDesigns
VBDesigns

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
email me if you'd like to get my CHOOK dll.  This subclasser hooks every message.  You only need to filter out the ones you want vs. setting the messages you want then filtering thoses ones for each.

here's an example:
dim myHook as new CHook

set myHook=new CHook
myHook.hWnd=yourwindow.hWnd

then you just do this when you form unloads

myHook.hWnd=0
set myHook=nothing

You don't even have form requirement.  So in otherwords if you were building an activex dll you don't nessecarily have to have a form in it to use a subclassing control

jnickle@shaw.wave.ca