Chinaunix首页 | 论坛 | 博客
  • 博客访问: 581823
  • 博文数量: 208
  • 博客积分: 3286
  • 博客等级: 中校
  • 技术积分: 1780
  • 用 户 组: 普通用户
  • 注册时间: 2007-09-24 20:38
文章分类

全部博文(208)

文章存档

2012年(7)

2011年(28)

2010年(21)

2009年(76)

2008年(65)

2007年(11)

我的朋友

分类:

2009-03-27 18:31:27

 
PreviousNext
Help Library

AskText

InstallShield 2009 » InstallScript Language Reference

The AskText function displays a dialog that contains one static text field and one edit box. Specify default text for the static text field in the parameter szQuestion. Specify default text for the edit box in the parameter szDefault.

    Note

    Note

  • You cannot use the function in conjunction with the AskText function. By default, the dialog appears in the center of the desktop, unless the background window mode is enabled. If the installation is in window mode, the dialog opens in the center of the background window.
  • The default title of this dialog is Enter Information. To change the contents of the title bar, call before calling AskText.

Syntax

AskText ( szQuestion, szDefault, svResult );

Parameters

AskText Parameters 

Parameter

Description

szQuestion

Specifies the question or statement to display. If the length of the string in this parameter exceeds the width of the static text field, one or more line breaks will be inserted into the string so that it displays on multiple lines in the dialog. If you prefer, you can format the string manually by inserting one or more newline escape sequences ( \n ) into it. This parameter does not have a default value.

szDefault

Specifies the default text for the edit box. The edit box scrolls, if necessary, to accommodate a long string.

svResult

Returns the text entered by the end user when the Next button is clicked to close the dialog. If the user clicks the Back button, the value of svResult will be unpredictable. Therefore, if you are using the same variable for both szDefault and svResult, be sure to reinitialize that variable when the return value from AskText is BACK.

Note

The string variable that you pass in svResult must be large enough to accommodate the text entered into the edit box. For that reason, you should use the autosize method to declare the variable.

Return Values

AskText Return Values 

Return Value

Description

NEXT (1)

Indicates that the end user clicked the Next button.

BACK (12)

Indicates that the end user clicked the Back button.

Additional Information

The dialog that is displayed by the AskText function cannot be displayed with a skin; it appears the same regardless of whether you have specified a skin.

See Also


InstallShield Help Library
5 June 2008
 | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
PreviousNext
Help Library

AskText Example

InstallShield 2009 » InstallScript Language Reference

Note

Note

To call this function in a Basic MSI setup, you must first create a custom action for the entry-point function, execute the custom action in a sequence or as the result of a dialog's control event, and then build the release.

/*-----------------------------------------------------------*\

*

* InstallShield Example Script

*

* Demonstrates the AskText function.

*

* This script gets a company name from the end user.

*

\*-----------------------------------------------------------*/

#define MSG_TEXT        "Please enter your company name."

#define DEFAULT_COMPANY "Acresso Software"

// Include Ifx.h for built-in InstallScript function prototypes.

#include "Ifx.h"

export prototype ExFn_AskText(HWND);

function ExFn_AskText(hMSI)

    STRING svCompany, szTitle;

    NUMBER nResult;

begin

    // Get the company name.

    nResult = AskText (MSG_TEXT, DEFAULT_COMPANY, svCompany);

    if nResult = NEXT then

        // Display the company name that was entered by the user.

        MessageBox ("Company: " + svCompany, INFORMATION);

    endif;

end;


InstallShield Help Library
5 June 2008
 | 
阅读(552) | 评论(0) | 转发(0) |
0

上一篇:AskPath

下一篇:AskYesNo

给主人留下些什么吧!~~