Смотрите видео ниже, чтобы узнать, как установить наш сайт в качестве веб-приложения на домашнем экране.
Примечание: Эта возможность может быть недоступна в некоторых браузерах.
[Setup]
AppName=MyApp
AppVername=MyApp
DefaultDirName={pf}\MyApp
[code]
const
GCL_STYLE = -26;
CS_NOCLOSE = $200;
var
Main1: TForm;
function GetClassLong(Wnd: HWnd; Index: Integer): Longint; external 'GetClassLongA@user32.dll stdcall';
function SetClassLong(Wnd: HWnd; Index: Integer; NewLong: Longint): Longint; external 'SetClassLongA@user32.dll stdcall';
procedure InitializeWizard;
begin
Main1:= TForm.Create(nil);
Main1.SetBounds(WizardForm.left-181,WizardForm.top-8, 500, 370);
Main1.Show;
SetClassLong(Main1.Handle, GCL_STYLE, GetClassLong(Main1.Handle, GCL_STYLE) or CS_NOCLOSE);
end;
В faq'e есть.
Код:[Setup] AppName=MyApp AppVername=MyApp DefaultDirName={pf}\MyApp [code] const GCL_STYLE = -26; CS_NOCLOSE = $200; var Main1: TForm; function GetClassLong(Wnd: HWnd; Index: Integer): Longint; external 'GetClassLongA@user32.dll stdcall'; function SetClassLong(Wnd: HWnd; Index: Integer; NewLong: Longint): Longint; external 'SetClassLongA@user32.dll stdcall'; procedure InitializeWizard; begin Main1:= TForm.Create(nil); Main1.SetBounds(WizardForm.left-181,WizardForm.top-8, 500, 370); Main1.Show; SetClassLong(Main1.Handle, GCL_STYLE, GetClassLong(Main1.Handle, GCL_STYLE) or CS_NOCLOSE); end;
[Setup]
AppName=MyApp
AppverName=MyApp
DefaultDirName={pf}\MyApp
[code]
const
MF_BYCOMMAND = 0;
MF_ENABLED = 0;
MF_GRAYED = 1;
MF_DISABLED = 2;
SC_CLOSE = 61536;
function GetSystemMenu(hWnd: HWND; bRevert: BOOL): LongWord; external 'GetSystemMenu@user32.dll stdcall';
function EnableMenuItem(hMenu: THandle; uIDEnableItem: Longword; uEnable: Longword): Boolean; external 'EnableMenuItem@user32.dll stdcall';
procedure MyClose(Sender: TObject; var CanClose: Boolean);
begin
if (WizardForm.CurPageID = wpWelcome) then begin
CanClose:= false;
Exit;
end;
end;
procedure InitializeWizard();
begin
WizardForm.OnCloseQuery:= @MyClose;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if (CurPageID = wpWelcome) then
EnableMenuItem(GetSystemMenu(WizardForm.Handle, false), SC_CLOSE, MF_DISABLED or MF_BYCOMMAND)
else
EnableMenuItem(GetSystemMenu(WizardForm.Handle, false), SC_CLOSE, MF_ENABLED or MF_BYCOMMAND);
end;
Timick
В данном случае пример для страницы wpWelcome
Код:[Setup] AppName=MyApp AppverName=MyApp DefaultDirName={pf}\MyApp [code] const MF_BYCOMMAND = 0; MF_ENABLED = 0; MF_GRAYED = 1; MF_DISABLED = 2; SC_CLOSE = 61536; function GetSystemMenu(hWnd: HWND; bRevert: BOOL): LongWord; external 'GetSystemMenu@user32.dll stdcall'; function EnableMenuItem(hMenu: THandle; uIDEnableItem: Longword; uEnable: Longword): Boolean; external 'EnableMenuItem@user32.dll stdcall'; procedure MyClose(Sender: TObject; var CanClose: Boolean); begin if (WizardForm.CurPageID = wpWelcome) then begin CanClose:= false; Exit; end; end; procedure InitializeWizard(); begin WizardForm.OnCloseQuery:= @MyClose; end; procedure CurPageChanged(CurPageID: Integer); begin if (CurPageID = wpWelcome) then EnableMenuItem(GetSystemMenu(WizardForm.Handle, false), SC_CLOSE, MF_DISABLED or MF_BYCOMMAND) else EnableMenuItem(GetSystemMenu(WizardForm.Handle, false), SC_CLOSE, MF_ENABLED or MF_BYCOMMAND); end;
[Setup]
AppName=MyApp
AppverName=MyApp
DefaultDirName={pf}\MyApp
OutputDir=.
[code]
const
MF_BYCOMMAND = 0;
MF_ENABLED = 0;
MF_GRAYED = 1;
MF_DISABLED = 2;
SC_CLOSE = 61536;
GCL_STYLE = -26;
CS_NOCLOSE = $200;
function GetSystemMenu(hWnd: HWND; bRevert: BOOL): LongWord; external 'GetSystemMenu@user32.dll stdcall';
function EnableMenuItem(hMenu: THandle; uIDEnableItem: Longword; uEnable: Longword): Boolean; external 'EnableMenuItem@user32.dll stdcall';
function GetClassLong(Wnd: HWnd; Index: Integer): Longint; external 'GetClassLongA@user32.dll stdcall';
function SetClassLong(Wnd: HWnd; Index: Integer; NewLong: Longint): Longint; external 'SetClassLongA@user32.dll stdcall';
procedure CurPageChanged(CurPageID: Integer);
begin
//if (CurPageID = wpInstalling) then
//begin
EnableMenuItem(GetSystemMenu(WizardForm.Handle, false), SC_CLOSE, MF_DISABLED or MF_BYCOMMAND);
SetClassLong(WizardForm.Handle, GCL_STYLE, GetClassLong(WizardForm.Handle, GCL_STYLE) or CS_NOCLOSE);
//end;
end;