Re: Newbie Needs Help



On Thu, 28 Apr 2005 22:34:46 -0400, frank tomken
<fstj2003@xxxxxxxxxxx> wrote:

>
>This line works for me to play an mp3 file achy breaky.
>
>ShellExecute(Handle, 'open',
> 'c:\program files\winamp\achy breaky.mp3',nil, nil, SW_SHOWNORMAL);
>
>But how do you change the mp3 file to a variable?

Uses ShellAPI;

procedure TForm1.Button1Click(Sender: TObject);
Var
Fle :String;
Ret :Integer;
begin
Fle := 'c:\notes.txt' ;
Ret := ShellExecute( Handle,'open', PChar( Fle ),
Nil, Nil, SW_SHOWNORMAL );
If Ret <= 32 Then
ShowMessage( 'Failed ShellExecute' );
end;

.


Quantcast