R.Wieser
2011-01-10 13:15:39 UTC
Hello all,
Just now I felt the need to write some code to monitor changes in the
registry.
It led me to the RegNotifyChangeKeyValue function on the MS site, which also
contained some example-code.
When I read it I got a bit put-off by the round-about way you seem to need
to use it: You either use it in a "don't return before you have something"
mode (freezing your program/thread with no described way to un-freeze it !)
or by using an event-object which you than effectivily *poll* using a
"WaitFor ....Object..." function.
So, you either freeze the program/thread completely, or freeze it for short
whiles. :-(
Isn't there *any* way to just create something which will message me about
changes (maybe using a WM_... message or a callback), but will also allow
itself to be ended/terminated without my (main) program having to wait until
the next time it wakes up ?
Regards,
Rudy Wieser
P.s.
Before someone thinks of using StartTrace, I've tried it. Although the
command claims everything went O.K. (return-value == 0) the returned
session-handle is not even accepted by a, for testing-purposes,
directly-following CloseTrace command (return-value == 6 : invalid entry).
A second time using StartTrace fails because some file(?) is already open
...
Just now I felt the need to write some code to monitor changes in the
registry.
It led me to the RegNotifyChangeKeyValue function on the MS site, which also
contained some example-code.
When I read it I got a bit put-off by the round-about way you seem to need
to use it: You either use it in a "don't return before you have something"
mode (freezing your program/thread with no described way to un-freeze it !)
or by using an event-object which you than effectivily *poll* using a
"WaitFor ....Object..." function.
So, you either freeze the program/thread completely, or freeze it for short
whiles. :-(
Isn't there *any* way to just create something which will message me about
changes (maybe using a WM_... message or a callback), but will also allow
itself to be ended/terminated without my (main) program having to wait until
the next time it wakes up ?
Regards,
Rudy Wieser
P.s.
Before someone thinks of using StartTrace, I've tried it. Although the
command claims everything went O.K. (return-value == 0) the returned
session-handle is not even accepted by a, for testing-purposes,
directly-following CloseTrace command (return-value == 6 : invalid entry).
A second time using StartTrace fails because some file(?) is already open
...