Semoga berhasil... Jika ada masalah kirim email ke : putu_dalungcity@yahoo.co.id
Nama : Abryan Tata Pangarsa
Web : abryantp.blogspot.com
Sourcecode [ Membuat program suara pada button ] :
unit Abryan;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, MMSystem;
type
TForm1 = class(TForm)
Button1: TButton;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
procedure WndProc(var Message : TMessage); override;
public
{ Public declarations }
end;
var
Form1: TForm1;
FSoundFile : String;
implementation
{$R *.DFM}
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;
procedure TForm1.FormCreate(Sender: TObject);
begin
FSoundFile := 'C:\Windows\Media\windows xp startup.wav';
end;
end.
ini pakai program ap? tlg yg jelas nm programnya karena saya masih pemula