同
同甘共苦
Unregistered / Unconfirmed
GUEST, unregistred user!
uses mmsystem;
{$R *.dfm}
function sound( P: Pointer): Longint;
stdcall;
var wavname: pchar;
begin
wavname := pchar(p^);
showmessage(wavname);//
playsound(wavname, 0, SND_ASYNC);//却无法播放
end;
procedure TForm1.FormCreate(Sender: TObject);
var
hThread: Thandle;
//定义一个句柄
ThreadID: DWord;
wavstring: string;
P: pointer;
begin
getmem(p, 255);
wavstring := extractfilepath(paramstr(0)) + 'wav/show.wav ';//show.wav 此路径是存在文件也存在
p := @wavstring;
hThread := CreateThread(nil, 0, @sound, p, 0, threadid);
end;
{$R *.dfm}
function sound( P: Pointer): Longint;
stdcall;
var wavname: pchar;
begin
wavname := pchar(p^);
showmessage(wavname);//
playsound(wavname, 0, SND_ASYNC);//却无法播放
end;
procedure TForm1.FormCreate(Sender: TObject);
var
hThread: Thandle;
//定义一个句柄
ThreadID: DWord;
wavstring: string;
P: pointer;
begin
getmem(p, 255);
wavstring := extractfilepath(paramstr(0)) + 'wav/show.wav ';//show.wav 此路径是存在文件也存在
p := @wavstring;
hThread := CreateThread(nil, 0, @sound, p, 0, threadid);
end;