Skip to content

Instantly share code, notes, and snippets.

@Nuc1eoN
Created August 17, 2014 14:52
Show Gist options
  • Save Nuc1eoN/8517d88c92b49ef9d2eb to your computer and use it in GitHub Desktop.
Save Nuc1eoN/8517d88c92b49ef9d2eb to your computer and use it in GitHub Desktop.
two var declarations in one procedure
procedure InitializeWizard;
// mp3 background music
var
ErrorCode: HRESULT;
ErrorText: WideString;
begin
ExtractTemporaryFile('InDeep.mp3');
if DSInitializeAudioFile(ExpandConstant('{tmp}\InDeep.mp3'),
@OnMediaPlayerEvent) then
begin
DSSetVolume(-2500);
DSPlayMediaFile;
end
else
begin
ErrorCode := DSGetLastError(ErrorText);
MsgBox('TDirectShowPlayer error: ' + IntToStr(ErrorCode) + '; ' +
ErrorText, mbError, MB_OK);
end;
end;
// Fullscreen Background Image
var
BackgroundBitmapImage: TBitmapImage;
BmpFileName: String;
begin
BmpFileName := ExpandConstant('{tmp}\Red Alert 2 wallpaper.bmp');
if
not FileExists(BmpFileName)
then
ExtractTemporaryFile(ExtractFileName(BmpFileName));
BackgroundBitmapImage := TBitmapImage.Create(MainForm);
BackgroundBitmapImage.Align := alClient;
BackgroundBitmapImage.Stretch := True;
BackgroundBitmapImage.Bitmap.LoadFromFile(BmpFileName);
BackgroundBitmapImage.Parent := MainForm;
WizardForm.Caption := MainForm.Caption;
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment