Created
August 17, 2014 14:52
-
-
Save Nuc1eoN/8517d88c92b49ef9d2eb to your computer and use it in GitHub Desktop.
two var declarations in one procedure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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