pascal - 创新设置。如何用鼠标移动窗口?
问题描述
在 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)
解决方案
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
好剧本给大家。
推荐阅读
- java - 如何退回给定客户的所有搁置订单
- python-3.x - python mss ScreenShotError
- function - 输入长度和按钮点击问题
- matlab - Matlab:提取存储在单元格数组中的所有图像的第 i_th 像素
- reactjs - 值不通过 React Context API 传递
- c# - 如何等待手术完成?
- c++ - 如何将 int 复制到 u_char*
- ios - UIScrollView:当从 firebase 调用用户名时,在滚动视图中显示用户个人资料图像
- node.js - 服务器上的 MongoDB net::ERR_CONNECTION_REFUSED
- string - Rust 字符串中的“growable”和“mutable”有什么区别?