在Form中重载wndproc:
procedure WndProc(var Message : TMessage); override;
procedure TForm1.WndProc(var Message : TMessage);
begin
if Message.LParam = Longint(Button1) then
begin
if (Message.Msg = CM_MOUSELEAVE) then
sndPlaySound(nil, snd_Async or snd_NoDefault);
if (Message.Msg = CM_MOUSEENTER) then
sndPlaySound(pchar(FSoundFile), snd_Async or snd_NoDefault);
end;
inherited WndProc(Message);
end;