var BackgroundForm: TForm; function ShowWindow(hWnd, nCmdShow: LongWord): LongWord; external 'ShowWindow@user32.dll stdcall'; function mciSendString(lpstrCommand: String; lpstrReturnString, uReturnLength, hwndCallback: Integer): Integer; external 'mciSendStringA@winmm.dll stdcall'; procedure BackgroundOnActivate(Sender: TObject); Begin if WizardForm.Visible then WizardForm.Show End; Procedure InitializeWizard; var errorCode: Integer; MyVideoFile: String; Begin MyVideoFile:= 'video.avi' // ваш фильм, клип, слайдшоу и т.п. BackgroundForm:= TForm.Create(nil) if not FileExists(MyVideoFile) then Exit; BackgroundForm.BorderStyle:= bsNone; BackgroundForm.OnActivate:= @BackgroundOnActivate; ShowWindow(BackgroundForm.Handle, sw_ShowMaximized) // фоновое окно на полный экран mciSendString('open '+ MyVideoFile +' alias AVIFile parent '+ IntToStr(BackgroundForm.Handle) +' style child',0,0,0) mciSendString('put AVIFile window at '+ IntToStr(BackgroundForm.Left) +' '+ IntToStr(BackgroundForm.Top) +' '+ IntToStr(BackgroundForm.Width) +' '+ IntToStr(BackgroundForm.Height),0,0,0) mciSendString('play AVIFile repeat',0,0,0) // повторять бесконечно End; Procedure DeinitializeSetup; Begin mciSendString('Close AVIFile',0,0,0) { закрыть AVI-файл} BackgroundForm.Free End; |