100字范文,内容丰富有趣,生活中的好帮手!
100字范文 > Inno setup MsgBox弹窗用法 以及 获取安装安装程序包的路径

Inno setup MsgBox弹窗用法 以及 获取安装安装程序包的路径

时间:2022-03-09 07:12:53

相关推荐

Inno setup MsgBox弹窗用法 以及 获取安装安装程序包的路径

Inno setup官方文档:/ishelp/

进入官网切换到index,往下划就可以找到MsgBox,以及其他一些你想要的信息。下面摘抄了MsgBox的使用方法。

Prototype:

function MsgBox(const Text: String; const Typ: TMsgBoxType; const Buttons: Integer): Integer;

Description:

Displays a message box.Textspecifies the message to display.Typspecifies which icon to display in the message box.Buttonsspecifies which buttons to include in the message box. Returns an ID* constant indicating the button the user clicked, or 0 if the function fails (which shouldn't happen unless an invalid parameter is specified or system resources are exhausted).

Remarks:

TMsgBoxType is defined as:

TMsgBoxType = (mbInformation, mbConfirmation, mbError, mbCriticalError);

Supported flags forButtonsare:

MB_OK, MB_OKCANCEL, MB_ABORTRETRYIGNORE, MB_YESNOCANCEL, MB_YESNO, MB_RETRYCANCEL, MB_DEFBUTTON1, MB_DEFBUTTON2, MB_DEFBUTTON3, MB_SETFOREGROUND

Possible return values are:

IDOK, IDCANCEL, IDABORT, IDRETRY, IDIGNORE, IDYES, IDNO

Example:

begin// Display a simple message box with an OK buttonMsgBox('Hello.', mbInformation, MB_OK);// Ask the user a Yes/No questionif MsgBox('Are you sure?', mbConfirmation, MB_YESNO) = IDYES thenbegin// user clicked Yesend;// Ask the user a Yes/No question, defaulting to Noif MsgBox('Are you sure?', mbConfirmation, MB_YESNO or MB_DEFBUTTON2) = IDYES thenbegin// user clicked Yesend;end;

See also:

SuppressibleMsgBox

TaskDialogMsgBox

其中MsgBox('Are you sure?', mbConfirmation, MB_YESNO or MB_DEFBUTTON2)表示有两按钮,一个是,默认选择否

MsgBox('Are you sure?', mbConfirmation, MB_YESNO)表示有两按钮,一个是,默认选择是

MsgBox('Hello.', mbInformation, MB_OK)表示只有一个按钮

支持的按钮类型有

MB_OK, MB_OKCANCEL, MB_ABORTRETRYIGNORE, MB_YESNOCANCEL, MB_YESNO, MB_RETRYCANCEL, MB_DEFBUTTON1, MB_DEFBUTTON2, MB_DEFBUTTON3, MB_SETFOREGROUND

{srcexe} 安装程序包的执行文件路径,即exe所在路径.

{src} 安装程序所在路径.

[Code]

var

ResultStrPath : String;

ResultStrPath := ExpandConstant('{srcexe}');

MsgBox(ResultStrPath , mbInformation, MB_OK);//弹窗显示安装程序包路径

Msgbox中换行为:#13#10//13 为回车字符

Msgbox('注意。' #13#10 '你是白痴!', mbConfirmation, MB_YESNO)

其他更多《Inno setup 常用修改技巧》见其他人的博客:/wzh200x/article/details/7190534

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。