wpLicese Page check if ScrollBars position is max (Inno Setup)

前端 未结 2 576
渐次进展
渐次进展 2020-12-21 09:28

Is it possible to check the position of ScrollBar in wpLicense Page in Inno Setup without having to write custom memo page?

e.g.

procedure CurPageCha         


        
2条回答
  •  情歌与酒
    2020-12-21 10:20

    That is what I have now. It works, however if you find any issues, just say as I like comments.

    procedure OnScrollPosition(Wnd: HWND; Msg: UINT; TimerID: UINT_PTR; 
      SysTime: DWORD);
      var
        ScrollInfo: TScrollInfo;
    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
              begin
                WizardForm.LicenseAcceptedRadio.Enabled := True;
                WizardForm.LicenseNotAcceptedRadio.Enabled := True;
              end;
    end;
    
    procedure ScrollPosition();
    var
      TimerCallback: LongWord;
    begin
      TimerCallback := WrapTimerProc(@OnScrollPosition, 4);
      TimerID := SetTimer(0, 0, 500, TimerCallback);
    end;
    
    procedure CurPageChanged(CurPageID: Integer);
    var
      ScrollInfo: TScrollInfo;
    begin
       if CurPageID = wpInstalling then
         StartSlideTimer
       else
         KillSlideTimer;
    if CurPageID = wpLicense then
      WizardForm.LicenseAcceptedRadio.Enabled := False;
      WizardForm.LicenseNotAcceptedRadio.Enabled := False;
      ScrollPosition
    end;
    

提交回复
热议问题