is there a way to hook events? so if i have form1 and a module full of subs could is there a way to insert a hook into a form event so that it would call a sub when the event has been raised?
Printable View
is there a way to hook events? so if i have form1 and a module full of subs could is there a way to insert a hook into a form event so that it would call a sub when the event has been raised?
hook events? ...those are two different things, hooks, and events. Hooks are something initiated by YOU. Events, on the other hand, is something initiated by an object, and sent to you.
However, this is what I understand from your explanation:
--- You wanna call a sub/function from one of your modules from an event handler in your form. Yes, thats is perfectly possible. In fact, that is highly recommended ;)
For example: When the user clicks a form...
'This is on the form
Private Sub Form_Click()
Call NotifyUser
End Sub
'-------------------------------------------
'This is in the module
Public Sub NotifyUser()
Msgbox "hey! you clicked the form!"
End Sub
================================
As for hooks, ....bahh ...tell me if that did not solve your problem.
And please be more specific with your questions.
sorry, what i was looking for was the api subclassing function. thank for your help any way. do you know where i could find the message constants by the way?
thanx
yes... I know of a good site. I dont know if this site has a listing of API Functions and constants, but as far as my experience goes, I dont get that info from this one.
For an API Functions Listing:
http://www.allapi.net
--- Download their API-Guide (Explanations and Examples), and their API-Toolshed (An almost complete listing of all API-Functions, replacement for VB`s API Viewer)
--- The website itself has a listing, together with examples, so if you dont wanna download, browse thru the site. I`m not sure whether they have a listing of Constants too... but I think its there somewhere...
For a listing of Windows messages, and their explanations:
http://www.vbAPI.com
For discussions about subclassing forms and windows:
1.> http://www.vbsquare.com/articles/sizegrip/index2.html
2.> http://www.vbsquare.com/articles/subcls/
Good Luck.
Hope that helps.
thanx, that waz exactly what i wanted...