![]() |
Order and save right now!
20% off with the 729824315 dicscount code for Ultimate Pack and any another product for Delphi from Greatis Programming! |
⤷ Play a sound on mouse enter
Use CM_MOUSEENTER and CM_MOUSELEAVE messages like this:
uses MMSystem;
TYourObject = class(TAnyControl)
...
private
procedure CMMouseEnter(var AMsg: TMessage); message CM_MOUSEENTER;
procedure CMMouseLeave(var AMsg: TMessage); message CM_MOUSELEAVE;
...
end;
implementation
procedure TYourObject.CMMouseEnter(var AMsg: TMessage);
begin
sndPlaySound('c:\win98\media\ding.wav',snd_Async or snd_NoDefault);
end;
procedure TYourObject.CMMouseLeave(var AMsg: TMessage);
begin
sndPlaySound(nil,snd_Async or snd_NoDefault);
end;
-
More for developers