Добавлено: 20.02.2007, 13:11
postal_3
спасибо что следиш за ней!..(1-й пост обновил)
спасибо что следиш за ней!..(1-й пост обновил)
Код: Выделить всё
function GetSystemMetrics(nIndex:Integer):Integer;
external '[email protected] stdcall';
procedure URLLabelOnClick(Sender: TObject);
var
ErrorCode: Integer;
begin
ShellExec('open', 'http://csmania.ru/', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;
var
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
RadioButton3: TRadioButton;
procedure InitializeWizard();
var
BackgroundBitmapImage: TBitmapImage;
s:string;
width, height:Integer;
URLLabel: TNewStaticText;
begin
RadioButton1 := TRadioButton.Create(WizardForm.FinishedPage);
with RadioButton1 do
begin
Parent := WizardForm.FinishedHeadingLabel.Parent;
Caption := 'Запуск Half-Life 2 Episode 2';
Left := ScaleX(180);
Top := ScaleY(155);
Width := ScaleX(177);
Height := ScaleY(17);
TabOrder := 0;
end;
RadioButton2 := TRadioButton.Create(WizardForm.FinishedPage);
with RadioButton2 do
begin
Parent := WizardForm.FinishedHeadingLabel.Parent;
Caption := 'Запуск Team Fortress 2';
Left := ScaleX(180);
Top := ScaleY(175);
Width := ScaleX(177);
Height := ScaleY(17);
TabOrder := 1;
end;
RadioButton3 := TRadioButton.Create(WizardForm.FinishedPage);
with RadioButton3 do
begin
Parent := WizardForm.FinishedHeadingLabel.Parent;
Caption := 'Запуск Portal';
Left := ScaleX(180);
Top := ScaleY(195);
Width := ScaleX(177);
Height := ScaleY(17);
TabOrder := 2;
end;
WizardForm.Position:=poScreenCenter;
MainForm.BORDERSTYLE:=bsNone;
width:=GetSystemMetrics(0);
height:=GetSystemMetrics(1);
MainForm.Left := 0;
MainForm.Top := 0;
MainForm.Width:=width;
MainForm.Height:=height;
width:=MainForm.ClientWidth;
height:=MainForm.ClientHeight;
ExtractTemporaryFile('background.bmp');
s:=ExpandConstant('{tmp}')+'\background.bmp';
BackgroundBitmapImage := TBitmapImage.Create(MainForm);
BackgroundBitmapImage.Bitmap.LoadFromFile(s);
BackgroundBitmapImage.Align := alClient;
BackgroundBitmapImage.Parent := MainForm;
BackgroundBitmapImage.Stretch:=True;
MainForm.Visible:=True;
URLLabel := TNewStaticText.Create(WizardForm);
URLLabel.Caption := '%)';
URLLabel.Parent := WizardForm;
URLLabel.Cursor := crHand;
URLLabel.OnClick := @URLLabelOnClick;
URLLabel.Font.Style := [fsUnderline];
URLLabel.Top := ScaleY(331);
URLLabel.Left := ScaleX(25);
end;
function NextButtonClick(CurPageID: Integer): Boolean;
var ResultCode: Integer;
begin
Result:=True;
if CurPageID=wpFinished then
begin
if RadioButton1.Checked then
Exec(ExpandConstant('{app}\RUN_EP2.exe'), '', '', SW_SHOW,ewNoWait, ResultCode)
else
if RadioButton2.Checked then
Exec(ExpandConstant('{app}\RUN_TF2.exe'), '', '', SW_SHOW,ewNoWait, ResultCode)
else
if RadioButton3.Checked then
Exec(ExpandConstant('{app}\RUN_PORTAL.exe'), '', '', SW_SHOW,ewNoWait, ResultCode)
end
end;
Код: Выделить всё
сonst
BASS_SAMPLE_LOOP = 4; //повторение
type
HSTREAM = DWORD; //тип звукового потока
function BASS_Init(device: Integer; freq, flags: DWORD; win: hwnd; CLSID: Integer): Boolean;
external 'BASS_Init@files:BASS.dll stdcall delayload';
function BASS_StreamCreateFile(mem: BOOL; f: PChar; offset: DWORD; length: DWORD; flags: DWORD): HSTREAM;
external 'BASS_StreamCreateFile@files:BASS.dll stdcall delayload';
function BASS_Start(): Boolean;
external 'BASS_Start@files:BASS.dll stdcall delayload';
function BASS_ChannelPlay(handle: DWORD; restart: BOOL): Boolean;
external 'BASS_ChannelPlay@files:BASS.dll stdcall delayload';
function BASS_Stop(): Boolean;
external 'BASS_Stop@files:BASS.dll stdcall delayload';
function BASS_Free(): Boolean;
external 'BASS_Free@files:BASS.dll stdcall delayload';
procedure InitializeWizard();
var
Name1: string;
i: Integer;
begin
ExtractTemporaryFile('BASS.dll');
ExtractTemporaryFile('01-OVERSEER-Doomsday.mp3');
if BASS_Init(-1, 44100, 0, 0, 0) then
begin
BASS_Start();
Name1:=ExpandConstant('{tmp}\01-OVERSEER-Doomsday.mp3');
i:=BASS_StreamCreateFile(FALSE, PChar(Name1), 0, 0, 4);
if i <> 0 then
begin
BASS_ChannelPlay(i, True);
end;
end;
end;
procedure DeInitializeSetup();
begin
BASS_Stop(); //нужно для остановки проигрывания
BASS_Free(); //нужно для быстрой выгрузки библиотеки вместе с муз. файлом
end;
да у меня тоже раньше было через виндовскую winmm.dll но вав большой слишком получаеться %)htuos писал(а):сих пор пользовался dll, которая проигрывает только wav