andrey_167
Новичок
еше один вопрос как зделать прибить данный код к отельной кнопке
точнее нужно чтобы вместо поместить на отдельную кнопку который также будет работать на странице установки
type
LPARAM = Integer;
WPARAM = Integer;
LRESULT = Integer;
TFNWndProc = Integer;
var
_oldproc: Longint;
function _CallWindowProc(lpPrevWndFunc: Longint; hWnd: HWND; Msg: UINT; wParam, lParam: Longint): Longint; external 'CallWindowProcA@user32.dll stdcall delayload';
function _SetWindowLong(hWnd: HWND; nIndex: Integer; dwNewLong: Longint): Longint; external 'SetWindowLongW@user32.dll stdcall delayload';
function _GetWindowLong(hWnd: HWND; nIndex: Integer): Longint; external 'GetWindowLongA@user32.dll stdcall';
const
GWL_STYLE = -16;
WM_SYSCOMMAND = $0112;
SC_MAXIMIZE = 61488;
WS_MAXIMIZEBOX = $10000;
WM_NCLBUTTONDBLCLK = $00A3;
var
PageResized: Boolean;
function GetSystemMetrics(nIndex:Integer):integer; external 'GetSystemMetrics@user32.dll stdcall delayload';
procedure MinimizeInstallPage();
begin
WizardForm.MainPanel.Visible:=False;
WizardForm.Bevel1.Visible:=False;
WizardForm.Width:=ScaleX(395);
WizardForm.Height:=ScaleY(142);
WizardForm.Left:=GetSystemMetrics(16)-ScaleX(420);
WizardForm.Top:=GetSystemMetrics(17)-ScaleX(150);
WizardForm.InnerNotebook.Left:=ScaleX(10);
WizardForm.InnerNotebook.Top:=ScaleY(10);
WizardForm.InnerNotebook.Width:=ScaleX(370);
WizardForm.StatusLabel.Left:=ScaleX(0);
WizardForm.StatusLabel.Top:=ScaleY(0);
WizardForm.StatusLabel.Width:=WizardForm.InnerNotebook.Width;
WizardForm.FileNameLabel.Left:=ScaleX(0);
WizardForm.FileNameLabel.Top:=ScaleY(20);
WizardForm.FileNameLabel.Width:=WizardForm.InnerNotebook.Width;
WizardForm.ProgressGauge.Top:=ScaleY(40);
WizardForm.ProgressGauge.Width:=WizardForm.InnerNotebook.Width;
WizardForm.CancelButton.Left:=ScaleX(220);
WizardForm.CancelButton.Top:=ScaleY(80);
WizardForm.CancelButton.BringToFront;
PageResized:= True
end;
procedure ResumeInstallPage();
begin
WizardForm.Width:= ScaleX(503);
WizardForm.Height:= ScaleY(388);
WizardForm.Position:= poScreenCenter;
_SetWindowLong(WizardForm.handle, GWL_STYLE, _GetWindowLong(WizardForm.handle, GWL_STYLE)or(WS_MAXIMIZEBOX));
_oldproc:=_SetWindowLong(WizardForm.Handle, -4, CallbackAddr('_FProc'));
WizardForm.MainPanel.Visible:=True;
WizardForm.Bevel1.Show;
WizardForm.InnerNotebook.SetBounds(ScaleX(40), ScaleY(72), ScaleX(417), ScaleY(237));
WizardForm.StatusLabel.SetBounds(ScaleX(0), ScaleY(0), ScaleX(417), ScaleY(16));
WizardForm.FilenameLabel.SetBounds(ScaleX(0), ScaleY(16), ScaleX(417), ScaleY(16));
WizardForm.ProgressGauge.SetBounds(ScaleX(0), ScaleY(42), ScaleX(417), ScaleY(21));
WizardForm.CancelButton.SetBounds(ScaleX(412), ScaleY(327), ScaleX(75), ScaleY(23));
PageResized:= False;
end;
function _FProc(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT;
begin
case Msg of WM_SYSCOMMAND:
case wParam of SC_MAXIMIZE:
begin
If PageResized then
ResumeInstallPage
else
MinimizeInstallPage;
wParam := 0;
end;
end;
end;
case Msg of WM_NCLBUTTONDBLCLK:
begin
Msg := 0;
end;
end;
Result := _CallWindowProc(_oldproc, hWnd, Msg, wParam, lParam);
end;
procedure InitializeWizard();
begin
_oldproc:=_SetWindowLong(WizardForm.Handle, -4, CallbackAddr('_FProc'));
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpInstalling then _SetWindowLong(WizardForm.handle, GWL_STYLE, _GetWindowLong(WizardForm.handle, GWL_STYLE)or(WS_MAXIMIZEBOX))
else _SetWindowLong(WizardForm.handle, GWL_STYLE, _GetWindowLong(WizardForm.handle, GWL_STYLE)and not(WS_MAXIMIZEBOX));
end;
procedure DeinitializeSetup();
begin
_SetWindowLong(WizardForm.Handle, -4, _oldproc);
end;
LPARAM = Integer;
WPARAM = Integer;
LRESULT = Integer;
TFNWndProc = Integer;
var
_oldproc: Longint;
function _CallWindowProc(lpPrevWndFunc: Longint; hWnd: HWND; Msg: UINT; wParam, lParam: Longint): Longint; external 'CallWindowProcA@user32.dll stdcall delayload';
function _SetWindowLong(hWnd: HWND; nIndex: Integer; dwNewLong: Longint): Longint; external 'SetWindowLongW@user32.dll stdcall delayload';
function _GetWindowLong(hWnd: HWND; nIndex: Integer): Longint; external 'GetWindowLongA@user32.dll stdcall';
const
GWL_STYLE = -16;
WM_SYSCOMMAND = $0112;
SC_MAXIMIZE = 61488;
WS_MAXIMIZEBOX = $10000;
WM_NCLBUTTONDBLCLK = $00A3;
var
PageResized: Boolean;
function GetSystemMetrics(nIndex:Integer):integer; external 'GetSystemMetrics@user32.dll stdcall delayload';
procedure MinimizeInstallPage();
begin
WizardForm.MainPanel.Visible:=False;
WizardForm.Bevel1.Visible:=False;
WizardForm.Width:=ScaleX(395);
WizardForm.Height:=ScaleY(142);
WizardForm.Left:=GetSystemMetrics(16)-ScaleX(420);
WizardForm.Top:=GetSystemMetrics(17)-ScaleX(150);
WizardForm.InnerNotebook.Left:=ScaleX(10);
WizardForm.InnerNotebook.Top:=ScaleY(10);
WizardForm.InnerNotebook.Width:=ScaleX(370);
WizardForm.StatusLabel.Left:=ScaleX(0);
WizardForm.StatusLabel.Top:=ScaleY(0);
WizardForm.StatusLabel.Width:=WizardForm.InnerNotebook.Width;
WizardForm.FileNameLabel.Left:=ScaleX(0);
WizardForm.FileNameLabel.Top:=ScaleY(20);
WizardForm.FileNameLabel.Width:=WizardForm.InnerNotebook.Width;
WizardForm.ProgressGauge.Top:=ScaleY(40);
WizardForm.ProgressGauge.Width:=WizardForm.InnerNotebook.Width;
WizardForm.CancelButton.Left:=ScaleX(220);
WizardForm.CancelButton.Top:=ScaleY(80);
WizardForm.CancelButton.BringToFront;
PageResized:= True
end;
procedure ResumeInstallPage();
begin
WizardForm.Width:= ScaleX(503);
WizardForm.Height:= ScaleY(388);
WizardForm.Position:= poScreenCenter;
_SetWindowLong(WizardForm.handle, GWL_STYLE, _GetWindowLong(WizardForm.handle, GWL_STYLE)or(WS_MAXIMIZEBOX));
_oldproc:=_SetWindowLong(WizardForm.Handle, -4, CallbackAddr('_FProc'));
WizardForm.MainPanel.Visible:=True;
WizardForm.Bevel1.Show;
WizardForm.InnerNotebook.SetBounds(ScaleX(40), ScaleY(72), ScaleX(417), ScaleY(237));
WizardForm.StatusLabel.SetBounds(ScaleX(0), ScaleY(0), ScaleX(417), ScaleY(16));
WizardForm.FilenameLabel.SetBounds(ScaleX(0), ScaleY(16), ScaleX(417), ScaleY(16));
WizardForm.ProgressGauge.SetBounds(ScaleX(0), ScaleY(42), ScaleX(417), ScaleY(21));
WizardForm.CancelButton.SetBounds(ScaleX(412), ScaleY(327), ScaleX(75), ScaleY(23));
PageResized:= False;
end;
function _FProc(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT;
begin
case Msg of WM_SYSCOMMAND:
case wParam of SC_MAXIMIZE:
begin
If PageResized then
ResumeInstallPage
else
MinimizeInstallPage;
wParam := 0;
end;
end;
end;
case Msg of WM_NCLBUTTONDBLCLK:
begin
Msg := 0;
end;
end;
Result := _CallWindowProc(_oldproc, hWnd, Msg, wParam, lParam);
end;
procedure InitializeWizard();
begin
_oldproc:=_SetWindowLong(WizardForm.Handle, -4, CallbackAddr('_FProc'));
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpInstalling then _SetWindowLong(WizardForm.handle, GWL_STYLE, _GetWindowLong(WizardForm.handle, GWL_STYLE)or(WS_MAXIMIZEBOX))
else _SetWindowLong(WizardForm.handle, GWL_STYLE, _GetWindowLong(WizardForm.handle, GWL_STYLE)and not(WS_MAXIMIZEBOX));
end;
procedure DeinitializeSetup();
begin
_SetWindowLong(WizardForm.Handle, -4, _oldproc);
end;
точнее нужно чтобы вместо поместить на отдельную кнопку который также будет работать на странице установки
Последнее редактирование: