OK, here's what I tried:
procedure TForm1.FormCreate(Sender: TObject);
begin
Application.OnActivate := AppActivate;
Application.OnDeactivate := AppDeactivate;
end;
procedure TForm1.AppActivate(Sender: TObject);
begin
with TRegistry.Create do
try
RootKey := HKEY_CURRENT_USER;
OpenKey('AppEvents\Schemes\Apps\Explorer\Navigating\.Current', False);
if ReadString('') <> '' then
RememberSoundFile := ReadString('');
WriteString('', '');
finally
Free;
end;
end;
procedure TForm1.AppDeactivate(Sender: TObject);
begin
with TRegistry.Create do
try
RootKey := HKEY_CURRENT_USER;
OpenKey('AppEvents\Schemes\Apps\Explorer\Navigating\.Current', False);
WriteString('', RememberSoundFile);
finally
Free;
end;
end;
It's fugly but it works. :-)
While I basically agree with Davy this solution at least has the advantage that other applications won't be affected.
I may add it as a user option to disable the click, but personally I really want it gone!