Re: Writing to a file within a Call Back Function
"sleeper" <TheFakeJon@gmail.com> wrote in message
news:1157684075.252535.208550@m73g2000cwd.googlegroups.com...
oh, well I wanted to learn how hooks work in Windows, so I decided that
the easiest way is to create a hooking procedure that logged keys. I
guess I could have done a slew of other projects...
OK. If this is an experiment or a learning exercise you are free to do
whatever you like. :-)
In a shipping application you should think very carefully about implementing
a system-wide hook, especially one which does I/O on every key stroke.
so conceptually, I want my hook to be minimally as intrusive, so if I
create a shared memory buffer between the two, this should still be
fine right?
Well, yes. Copying a keystroke to memory is a lot less expensive than an I/O
operation.
How about a pipe? I think pipes would be relatively easy
to implement...
Yup. In fact, CallNamedPipe() dumbs down the client side of the pipe to a
single line. But it is not going to return until the message has received a
reply. IMO, this is not the kind of thing that you should be doing inside a
hook procedure.
Regards,
Will