加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

wpLicese页面检查ScrollBars位置是否为max(Inno Setup)

发布时间:2020-12-15 03:50:13 所属栏目:大数据 来源:网络整理
导读:是否可以在Inno Setup的wpLicense页面中检查ScrollBar的位置而无需编写自定义备忘录页面? 例如 procedure CurPageChanged(CurPageID: Integer); begin if CurPageID = wpLicense then WizardForm.LicenseAcceptedRadio.Enabled := False; WizardForm.Licens
是否可以在Inno Setup的wpLicense页面中检查ScrollBar的位置而无需编写自定义备忘录页面?

例如

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功能:
[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 'GetScrollInfo@user32.dll 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;

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读