Вопрос Озвучка кнопок

ROMKA-1977

Новичок
Помогите пож. со следующим кодом:
Код:
[Setup]
AppName=My Program
AppVerName=My Program v 1.5
DefaultDirName={pf}\My Program
DefaultGroupName=My Program
OutputDir=.

[Files]
Source: click.wav; DestDir: {tmp}; Flags: dontcopy;

[Code]
function sndPlaySound(lpszSoundName: string; uFlags: cardinal):integer;
external 'sndPlaySoundA@winmm.dll stdcall';


function InitializeSetup(): Boolean;
begin
ExtractTemporaryFile('click.wav');
Result := True;
end;

function NextButtonClick(CurPageID: Integer): Boolean;
begin
sndPlaySound(ExpandConstant('{tmp}\click.wav'), $0001);
Result := True;
end;

function BackButtonClick(CurPageID: Integer): Boolean;
begin
sndPlaySound(ExpandConstant('{tmp}\click.wav'), $0001);
Result := True;
end;

function DirBrowseButtonClick(CurPageID: Integer): Boolean;
begin
sndPlaySound(ExpandConstant('{tmp}\click.wav'), $0001);
Result := True;
end;

function GroupBrowseButtonClick(CurPageID: Integer): Boolean;
begin
sndPlaySound(ExpandConstant('{tmp}\click.wav'), $0001);
Result := True;
end;

procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
sndPlaySound(ExpandConstant('{tmp}\click.wav'), $0001);
end;
Проблема: озвучка на кнопки "обзор" не накладывается.
 

nik1967

Old Men
Проверенный
ROMKA-1977,
Код:
[Setup]
AppName=My Program
AppVerName=My Program v 1.5
DefaultDirName={pf}\My Program
DefaultGroupName=My Program
OutputDir=.

[Files]
Source: click.wav; DestDir: {tmp}; Flags: dontcopy;

[Code]
#define A = (Defined UNICODE) ? "W" : "A"

var
  OldEvent_DirBrowseButtonClick: TNotifyEvent;
  OldEvent_GroupBrowseButtonClick: TNotifyEvent;
 
function sndPlaySound(lpszSoundName: string; uFlags: cardinal):integer; external 'sndPlaySound{#A}@winmm.dll stdcall';

function InitializeSetup(): Boolean;
begin
   ExtractTemporaryFile('click.wav');
   Result:= True;
end;

function NextButtonClick(CurPageID: Integer): Boolean;
begin
   sndPlaySound(ExpandConstant('{tmp}\click.wav'), $0001);
   Result:= True;
end;

function BackButtonClick(CurPageID: Integer): Boolean;
begin
   sndPlaySound(ExpandConstant('{tmp}\click.wav'), $0001);
   Result:= True;
end;

procedure DirBrowseButtonClick(Sender: TObject);
begin
   sndPlaySound(ExpandConstant('{tmp}\click.wav'), $0001);
   OldEvent_DirBrowseButtonClick(Sender);
end;

procedure GroupBrowseButtonClick(Sender: TObject);
begin
   sndPlaySound(ExpandConstant('{tmp}\click.wav'), $0001);
   OldEvent_GroupBrowseButtonClick(Sender);
end;

procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
   sndPlaySound(ExpandConstant('{tmp}\click.wav'), $0001);
end;

procedure InitializeWizard(); 
begin
   with WizardForm.DirBrowseButton do begin
     OldEvent_DirBrowseButtonClick:= OnClick;
     OnClick:= @DirBrowseButtonClick;
   end;
   with WizardForm.GroupBrowseButton do begin
     OldEvent_GroupBrowseButtonClick:= OnClick;
     OnClick:= @GroupBrowseButtonClick;
   end;
end;
 
Последнее редактирование:
Сверху