I've an application which uses several dll's depending on profiles etc. In one of the dll's I use RegisterShellEvent & UnRegisterShellEvent:
WriteToLog(Self, Format('Trying to monitor %s', [GetDataFile]), llTrace);
FActive := RegisterShellEvent(
[seItemCreated, seItemChanged, seItemDeleted]
if FActive then
WriteToLog(Self, Format('Started monitoring of %s', [GetDataFile]), llTrace);
WriteToLog(Self, Format('Trying to unmonitor %s', [GetDataFile]), llTrace);
if UnRegisterShellEvent(ShellEvent) then
WriteToLog(Self, Format('Finished monitoring of %s', [GetDataFile]), llTrace);
FActive := False;
In the log file, I see that the monitoring starten, but I see also that it never got to the finished point. ie I see the logmsg 'Trying to unmonitor', but not the message 'Finished monitoring' so I assume the UnRegisterShellEvent returns false.
I do also get an AV when destroying the dll. (normal I guess with the above issue)
Is there a way to find out why the UnRegister fails?
Thanks in advance
Did some further debugging and see that something else must be causing the AV, the debugging log just pointed me to a wrong assumption.
Would be nice to let the UnRegisterShellEvent return true at a certain moment.