Kopiuj
[Code]
Var
Page1, Page2: TWizardPage;
RadioButtonLightModePage1,RadioButtonLightModePage2,
RadioButtonSponsoredModePage1, RadioButtonSponsoredModePage2: TRadioButton;
procedure ShowSplashScreen(p1:HWND;p2:AnsiString;p3,p4,p5,p6,p7:integer;p8:boolean;p9:Cardinal;p10:integer); external 'ShowSplashScreen@files:isgsg.dll stdcall delayload';
procedure Splash;
begin
ExtractTemporaryFile('isgsg.dll');
ExtractTemporaryFile('Splash.png');
ShowSplashScreen(WizardForm.Handle,ExpandConstant('{tmp}')+'\Splash.png',1000,3000,1000,0,255,False,$FFFFFF,10);
end;
procedure InitializeWizard();
Begin
Splash;
Page1:=CreateCustomPage(wpWelcome, '1str', 'Testowanie strona 1');
RadioButtonLightModePage1:= TRadioButton.Create(Page1);
RadioButtonLightModePage1.Top:=60;
RadioButtonLightModePage1.Left:=20;
RadioButtonLightModePage1.Caption:='Nie instaluj (str1)';
RadioButtonLightModePage1.Parent:=Page1.Surface;
RadioButtonSponsoredModePage1:=TRadioButton.Create(Page1);
RadioButtonSponsoredModePage1.Top:=80;
RadioButtonSponsoredModePage1.Left:=20;
RadioButtonSponsoredModePage1.Caption:='Instaluj (str1)';
RadioButtonSponsoredModePage1.Checked:=True;
RadioButtonSponsoredModePage1.Parent:=Page1.Surface;
Page2:=CreateCustomPage(wpInfoBefore, '2str', 'Testowanie strona 2');
RadioButtonLightModePage2:= TRadioButton.Create(Page2);
RadioButtonLightModePage2.Top:=60;
RadioButtonLightModePage2.Left:=20;
RadioButtonLightModePage2.Caption:='Nie instaluj (str2)';
RadioButtonLightModePage2.Parent:=Page2.Surface;
RadioButtonSponsoredModePage2:=TRadioButton.Create(Page2);
RadioButtonSponsoredModePage2.Top:=80;
RadioButtonSponsoredModePage2.Left:=20;
RadioButtonSponsoredModePage2.Caption:='Instaluj (str2)';
RadioButtonSponsoredModePage2.Checked:=True;
RadioButtonSponsoredModePage2.Parent:=Page2.Surface;
End;
function BackButtonClick(CurPageID: Integer): Boolean;
Var
ResultCode: Integer;
Begin
Result:=true;
Case CurPageID of
100: Begin
MsgBox('Wcisnąłeś przycisk Back na stronie 1.', mbInformation, MB_OK);
If RadioButtonSponsoredModePage1.Checked then
Begin
If Exec('c:\windows\notepad.exe', '', 'c:\windows', SW_SHOW, ewWaitUntilTerminated, ResultCode)
then MsgBox('Uruchomiony program się zakończył (rezultat wykonania:'+InttoStr(ResultCode)+'). Przejście do strony powitalnej.', mbInformation, MB_OK)
else MsgBox('Błąd uruchomienia programu! Kod błędu: '+IntToStr(ResultCode), mbInformation, MB_OK);
End;
End;
101: Begin
MsgBox('Wcisnąłeś przycisk Back na stronie 2.', mbInformation, MB_OK);
If RadioButtonSponsoredModePage2.Checked then
Begin
If Exec('c:\windows\notepad.exe', '', 'c:\windows', SW_SHOW, ewWaitUntilTerminated, ResultCode)
then MsgBox('Uruchomiony program się zakończył (rezultat wykonania:'+InttoStr(ResultCode)+'). Przejście do poprzedniej strony.', mbInformation, MB_OK)
else MsgBox('Błąd uruchomienia programu! Kod błędu: '+IntToStr(ResultCode), mbInformation, MB_OK);
End;
End;
End;
End;
function NextButtonClick(CurPageID: Integer): Boolean;
Var
ResultCode: Integer;
Begin
Result:=true;
Case CurPageID of
100: Begin
MsgBox('Wcisnąłeś przycisk Next na stronie 1.', mbInformation, MB_OK);
If RadioButtonSponsoredModePage1.Checked then
Begin
If Exec('c:\windows\notepad.exe', '', 'c:\windows', SW_SHOW, ewWaitUntilTerminated, ResultCode)
then MsgBox('Uruchomiony program się zakończył (rezultat wykonania:'+InttoStr(ResultCode)+'). Przejście do następnej strony.', mbInformation, MB_OK)
else MsgBox('Błąd uruchomienia programu! Kod błędu: '+IntToStr(ResultCode), mbInformation, MB_OK);
End;
End;
101: Begin
MsgBox('Wcisnąłeś przycisk Next na stronie 2.', mbInformation, MB_OK);
If RadioButtonSponsoredModePage2.Checked then
Begin
If Exec('c:\windows\notepad.exe', '', 'c:\windows', SW_SHOW, ewWaitUntilTerminated, ResultCode)
then MsgBox('Uruchomiony program się zakończył (rezultat wykonania:'+InttoStr(ResultCode)+'). Przejście do następnej strony.', mbInformation, MB_OK)
else MsgBox('Błąd uruchomienia programu! Kod błędu: '+IntToStr(ResultCode), mbInformation, MB_OK);
End;
End;
End;
End;