在Inno Setup中,我用公式删除了窗口的边框
WizardForm.BorderStyle:= bsNone; (效果很好。)
目前,我想用鼠标移动窗口。 我在Lazarus下编写了此代码,效果很好,但是如果我在Inno Setup中应用相同的代码,则不会 工作。您能帮我吗,因为我找不到解决方案。谢谢。
[Code]
procedure InitializeWizard();
//Remove the border of the window.
var
ClientWidth: Integer;
ClientHeight: Integer;
begin
ClientWidth := WizardForm.ClientWidth;
ClientHeight := WizardForm.ClientHeight;
WizardForm.BorderStyle := bsNone;
WizardForm.ClientWidth := ClientWidth;
WizardForm.ClientHeight := ClientHeight;
end;
//Move the window with the mouse.
var
MouseIsDown: boolean;
PX, PY: integer;
procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if Button = mbLeft then
begin
MouseIsDown := True;
PX := X;
PY := Y;
end;
end;
procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
if MouseIsDown then
begin
SetBounds(Left + (X - PX), Top + (Y - PY), Width, Height);
end;
end;
procedure FormMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
MouseIsDown:=False;
end;
end.
procedure DeInitializeSetup();
begin
end;
// End of file (EOF)
答案 0 :(得分:1)
Inno Setup-用鼠标移动窗口。
大家好,
当我们删除窗口的边框时,必须能够用鼠标移动它。
我给您发送解决方案:
为此,必须使用Inno Setup和Graphical Installer。
重要的是下载最新版本。
以下是链接:
Inno设置:http://www.jrsoftware.org/
图形安装程序:http://graphical-installer.com/joomla/index.php/purchase/free-trial
1 /安装2个应用程序。
2 /复制以下代码,并将其粘贴到Inno Setup的代码部分(您的脚本)中。
3 /运行。
[Code]
// Next functions are used for proper working of Graphical Installer powered installer
procedure InitializeWizard();
//This function allows you to delete the border of the window
var
ClientWidth: Integer;
ClientHeight: Integer;
begin
ClientWidth := WizardForm.ClientWidth;
ClientHeight := WizardForm.ClientHeight;
WizardForm.BorderStyle := bsNone;
WizardForm.ClientWidth := ClientWidth;
WizardForm.ClientHeight := ClientHeight;
//This function allows you to drag the window with the mouse
begin
#ifdef GRAPHICAL_INSTALLER_PROJECT
WizardForm.EnableDragging();
#endif
end;
#ifdef GRAPHICAL_INSTALLER_PROJECT
InitGraphicalInstaller();
#endif
end;
// Next function is used for proper working of Graphical Installer powered installer
procedure CurPageChanged(CurPageID: Integer);
begin
#ifdef GRAPHICAL_INSTALLER_PROJECT
PageChangedGraphicalInstaller(CurPageID);
#endif
end;
// Next function is used for proper working of Graphical Installer powered installer
procedure DeInitializeSetup();
begin
#ifdef GRAPHICAL_INSTALLER_PROJECT
DeInitGraphicalInstaller();
#endif
end;
// End of file (EOF)
重要:
移动窗口仅通过将鼠标光标置于窗口底部才能激活。
您可以在Graphical Installer的在线手册中阅读此功能。
(请参见页面底部的标题为“拖动安装窗口”。)
这是链接:
http://graphical-installer.com/files/manuals/inno/source/html/intro%20-%20project-api.html
所有人的好脚本。