Цитата Venelana:
отключить кнопку "Отмена" во время установки »
|
Код:
procedure CurPageChanged( const CurPageID: Integer );
begin
case CurPageID of
wpInstalling: WizardForm.CancelButton.Enabled := False;
end;
end;
Предыдущий пример отключает видимость кнопки.
Думаю, если уж лишать пользователя возможности отменить установку, то следует, также, отключить кнопку закрытия на бордюре окна. Хотя, в таскбаре окно все равно можно будет закрыть.
Код:
#define A = (Defined UNICODE) ? "W" : "A"
const
GCL_STYLE = - 26;
CS_NOCLOSE = $0200;
function SetClassLong( hWnd: HWND; nIndex: Integer; dwNewLong: Longint ): DWORD; external 'SetClassLong{#A}@user32.dll stdcall';
function GetClassLong( hWnd: HWND; nIndex: Integer ): DWORD; external 'GetClassLong{#A}@user32.dll stdcall';
procedure CurPageChanged( const CurPageID: Integer );
begin
case CurPageID of
wpInstalling:
begin
WizardForm.CancelButton.Enabled := False;
SetClassLong( WizardForm.Handle, GCL_STYLE, ( GetClassLong( WizardForm.Handle, GCL_STYLE ) or CS_NOCLOSE ) );
end;
end;
end;