1. In Dialogs view, right-click All Dialog, select New dialog box (new Dialog)
2. Create a blank dialog box named Mydlg.
3. Double-click the subkey under Mydlg to enter the edit mode of the dialog box
4. Here we add a Hello button. Select the button control and then drag a button control on the interface of the dialog box.
Modify Button property text is hello. Notice the control identifer attribute value here, which we'll use later.
5. Create a new Rul file in the InstallScript view, named Mydlg.url
6. Preparation of Mydlg.url
The contents are as follows:
#define DLG_MYDLG "Mydlg"//mydlg is our dialog box name.
#define HELLOBTN 1301//1301 is the control Identifer property value of our button.
Prototype number Mydlg (BYREF STRING);
function number Mydlg (msg)
HWND Hdlg;
Number NId, Nresult;
Number Ncontrol;
BOOL Bdone;
Begin
Initial dialog box function
if (Ezdefinedialog (Dlg_mydlg,isuser, "Mydlg", 0) = Dlg_err) Then
return iserr_gen_failure;
endif
Bdone = FALSE;
Cycle
while (!bdone)
NId = Waitondialog (DLG_MYDLG); Get a message for a dialog box
Switch (NID)
Case HELLOBTN://If it is hellobtn
MessageBox (msg,warning);
Bdone=true;
Case DLG_ERR:
NId = iserr_gen_failure;
Sderror (NId, Dlg_mydlg);
Bdone = TRUE;
Case Dlg_close:
Sdclosedlg (Hdlg, NId, bdone);
Default
Check Standard handling
if (Sdisstdbutton (nId) && Sddostdbutton (nId)) Then
Bdone = TRUE;
endif
Endswitch;
Endwhile;
End
7.setup.url content:
Added is #include "Mydlg.rul"
And our custom dialog box. The rest of the code is automatically generated.
The Install UI sequence-before move Data
//
The Onfirstuibefore event is called by Onshowui when the "Setup is"
Running in the install mode. By default this event displays UI allowing
The end user to specify installation parameters.
//
Note:this event won't is called automatically in a
Program...endprogram style setup.
//---------------------------------------------------------------------------
#include "Mydlg.rul"
function Onfirstuibefore ()
Number Nresult, Nlevel, nsize, Nsetuptype;
String SzTitle, szmsg, SZOPT1, SzOpt2, Szlicensefile;
String SzName, Szcompany, Sztargetpath, Szdir, szfeatures;
BOOL blicenseaccepted;
Begin
Nsetuptype = COMPLETE;
Szdir = TARGETDIR;
SzName = "";
Szcompany = "";
blicenseaccepted = FALSE;
Beginning of UI Sequence
Dlg_start:
Nresult = 0;
Dlg_sdwelcome:
SzTitle = "";
szmsg = "";
{{Is_script_tag (dlg_sdwelcome)
Nresult = SdWelcome (SzTitle, szmsg);
}}is_script_tag (Dlg_sdwelcome)
if (nresult = back) goto Dlg_start;
Dlg_hello:
Our custom dialog box
Sztitle= "";
Szmsg= "It's My Hello DLG";
Nresult=mydlg (szmsg);
if (nresult=back) goto Dlg_start;
。。。。
Dlg_sdregisteruser:
szmsg = "";
SzTitle = "";
{{Is_script_tag (Dlg_sdregisteruser)
Nresult = SdRegisterUser (SzTitle, szmsg, SzName, Szcompany);
}}is_script_tag (Dlg_sdregisteruser)
if (nresult = back) goto Dlg_mydlg;
。。。。
Compile and run to see your own side box.