本文介绍了wpLicese Page检查ScrollBars位置是否最大(Inno Setup)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以在Inno Setup的wpLicense页面中检查ScrollBar的位置而无需编写自定义备忘录页面?
Is it possible to check the position of ScrollBar in wpLicense Page in Inno Setup without having to write custom memo page?
例如
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpLicense then
WizardForm.LicenseAcceptedRadio.Enabled := False;
WizardForm.LicenseNotAcceptedRadio.Enabled := False;
if ScrollBar.Position := ScrollBar.Max then
WizardForm.LicenseAcceptedRadio.Enabled := True;
WizardForm.LicenseNotAcceptedRadio.Enabled := True;
end;
推荐答案
没有直接访问这些滚动条的方法,但是您可以使用 GetScrollInfo
的功能如下:
There is no direct access to those scroll bars, however you can use the GetScrollInfo
function this way:
[code]
const
SB_VERT = 1;
SIF_RANGE = 1;
SIF_POS = 4;
SIF_PAGE = 2;
type
TScrollInfo = record
cbSize: UINT;
fMask: UINT;
nMin: Integer;
nMax: Integer;
nPage: UINT;
nPos: Integer;
nTrackPos: Integer;
end;
function GetScrollInfo(hWnd: HWND; BarFlag: Integer;
var ScrollInfo: TScrollInfo): BOOL;
external '[email protected] stdcall';
procedure CurPageChanged(CurPageID: Integer);
var
ScrollInfo: TScrollInfo;
begin
if CurPageID = wpLicense then
begin
ScrollInfo.cbSize := SizeOf(ScrollInfo);
ScrollInfo.fMask := SIF_RANGE or SIF_POS or SIF_PAGE;
if GetScrollInfo(WizardForm.LicenseMemo.Handle, SB_VERT, ScrollInfo) then
if ScrollInfo.nPos = ScrollInfo.nMax - ScrollInfo.nPage then
MsgBox('You are at the end of the license!', mbInformation, MB_OK);
end;
end;
这篇关于wpLicese Page检查ScrollBars位置是否最大(Inno Setup)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!