The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: 2-Bit Chip on September 27, 2009, 08:34:14 PM

Title: On The Event Of ...
Post by: 2-Bit Chip on September 27, 2009, 08:34:14 PM
I can not think up any ways to make event handler.


What ideas could make an event handler? A gigantic loop? A driver for the system (.sys)?
Title: Re: On The Event Of ...
Post by: BlackVortex on September 27, 2009, 09:05:19 PM
What kinds of event do you want to monitor ? I like windows callback system with SetWindowsHookEx ... is that any help to you ?
Title: Re: On The Event Of ...
Post by: 2-Bit Chip on September 28, 2009, 12:56:55 AM
It would be custom event handlers.

For an IRC protocol wrapper, it would need to run independent of the program (threaded) to grab what is being said at real-time. It would need to have

invoke irc_sethandler, OFFSET on_private_msg, IRC_EVENT_PRIVMSG
or
invoke irc_sethandler, OFFSET on_all_events, IRC_EVENT_ALL



I really hope you can understand this clutter. :red
Title: Re: On The Event Of ...
Post by: hutch-- on October 03, 2009, 04:58:38 AM
2 bit,

How regularly do you need to poll the event you want to monitor ?

It would be easy enough to set up a timer every 100ms or perhaps longer interval so the app that watches does not use much processor time.
Title: Re: On The Event Of ...
Post by: BogdanOntanu on October 03, 2009, 08:33:04 AM
Thou shall not make a gigantic loop unless you are a 8bit bit real time microcontroller.

Thou shall create a set of sincronization objects for each event.
Thou shall WaitForMultipleObjects or single objects to be signaled by the OS when a desired event occurs.

Thou may use callbacks for the same purpose (if available).