ViperX
asked on
Hooking
How would I be able to hook a window to recieve its messages without having to buy and expencive control?
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.hWn d
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
here's an example:
dim myHook as new CHook
set myHook=new CHook
myHook.hWnd=yourwindow.hWn
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