Malcolm said:
Windows works by sending "messages" to windows.
If we are writing our program in C, we instantly have a problem. C only
allows us to call functions, not to receive messages.
The workaround is to pass a pointer to a message processing function to the
Windows system. Windows then calls this function from its internals. That is
one example of why function pointers can be useful.
Off-topic as this is, what on earth are you babbling about? Windows
implements message queues, and requires you to implement a callback function
for processing these message queues. This is not a "workaround", it's the
way things are implemented. It's a workaround only insofar as messages do
not magically appear somewhere.
Now there will be ways to getting Windows to log the calls it makes to the
message processing functions, and there will be ways of getting Windows to
generate such calls.
Which is not at all what OP's asking. The "event" is just a packet of data
with some structure in it. You add them to the event log by calling
ReportEvent() on an event log you opened with OpenEventLog(). You do not
even need to create windows for this, and services usually do not.
My advice to the OP is to forget everything they've read so far.
However that takes us too far from the C language issues of your question
and into the details of the Windows implementation, which is not topical
here. However comp.os.windows.programmer will probably be only too happy
to help.
Yes. Directing people to the correct newsgroup without further ado is the
best course of action. You should usually leave it at that, lest you lose
the benefit of such redirecting (reduced OT traffic).
S.