本文介绍了如何在一定时间后关闭已完成的Inno安装程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
一段时间后如何在已完成页面关闭安装程序?
也可以解释为:在一段时间不活动后如何关闭安装程序?(关闭/取消安装)。这可能吗?
推荐答案在显示"已完成"页面以触发关闭后设置计时器。
[Code] function SetTimer(hWnd, nIDEvent, uElapse, lpTimerFunc: LongWord): LongWord; external 'SetTimer@User32.dll stdcall'; function KillTimer(hWnd, nIDEvent: LongWord): LongWord; external 'KillTimer@User32.dll stdcall'; var PageTimeoutTimer: LongWord; PageTimeout: Integer; procedure UpdateFinishButton; begin WizardForm.NextButton.Caption := Format(SetupMessage(msgButtonFinish) + ' - %ds', [PageTimeout]); end; procedure PageTimeoutProc( H: LongWord; Msg: LongWord; IdEvent: LongWord; Time: LongWord); begin if PageTimeout > 1 then begin Dec(PageTimeout); UpdateFinishButton; end else begin WizardForm.NextButton.OnClick(WizardForm.NextButton); end; end; procedure CurPageChanged(CurPageID: Integer); begin if CurPageID = wpFinished then begin PageTimeout := 10; UpdateFinishButton; PageTimeoutTimer := SetTimer(0, 0, 1000, CreateCallback(@PageTimeoutProc)); end; end; function NextButtonClick(CurPageID: Integer): Boolean; begin if CurPageID = wpFinished then begin KillTimer(0, PageTimeoutTimer); PageTimeoutTimer := 0; end; Result := True; end;对于CreateCallback function,您需要Inno安装程序6。如果您使用Inno安装程序5,则可以使用InnoTools InnoCallback库中的WrapCallback函数。
相关问题:
- MsgBox - Make unclickable OK Button and change to countdown - Inno Setup;
- Inno Setup - Automatically submitting uninstall prompts。
更多推荐
如何在一定时间后关闭已完成的Inno安装程序?
发布评论