InstallShieldx Installation Make Not Notes (Custom Dialog)

xiaoxiao2021-03-06  35

Author: fbysssBlog: blog.9cbs.net/fbysss Disclaimer: This article from the original fbysss, reproduced or quoted, please indicate the reference address. How to call the custom dialog? There is an explanation in the InstallShield Help, but there are some links that can't be successful. For example, ControlID, DialogID, etc. Through your own exploit, I completed the establishment of the custom dialog, the event is written, and now I will sort out, I hope to help you. 1. New dialog (1) Create a Dialog in User Interface-> Dialogs, named FBYSSSDIALOG; (2) Add a Text Area through the Control Tool Bar, the Text property fills in "My Custom Dialog"; (3) Add three PUSH Button, set the text attribute to BACK, OK, NEXT, and Control Identifier, respectively, set to 14, 13, 15, respectively. Other controls can be added as needed; (4) Additional Tools-> Direct Editor finds Dialog, setting FBYSSSSDIALOG ISResourceId to 10333 (if there is repetition to change the number). 2. Write a dialog event to create a new script file, name, such as the code called "fbessssdialog.rul":

#define res_dialog_id 10333 // Dialog Box ID # define res_pbut_next 15 // Next button ID # define res_pBut_ok 13 // OK button ID # define res_pBut_back 14 // BACK button ID # include "ifx.h"

Export Prototype EX_DEFINEDIALOG (HWND);

Function EX_DEFINEDIALOG (HMSI) String Szdialogname, SZDLLNAME, SZDIALOG; NCMDVALOG, NRESULT, NCMDVALUE; BOOL BDONE; HWND HINSTANCE, HWNDPARENT; // String Svalue; Begin

SZDIALOGNAME = "custom dialog"; hinstance = 0; // default szdllname = ""; default

SZDIALOG = ""; // If the ID of the dialog is specified, it is set to an empty string. hwndParent = 0; // retention parameters, must be 0 nResult = DefineDialog (szDialogName, hInstance, szDLLName, RES_DIALOG_ID, szDialog, hwndParent, HWND_INSTALL, DLG_MSG_STANDARD | DLG_CENTERED); // error checking if (nResult <0) then MessageBox ( "Error ", Severe); bdone = true;

BDONE = false;

// Cycle Repeat

// Display the dialog, NcomValue returns the event in the dialog, if normal, return to the control id ncmdvalue = Waitondialog (Szdialogname); // NumTostr (szzalue, ncmdvalue); // MessageBox (Svalue, Information); Switch (ncmdvalue) Case DLG_Close: // Close Window DO (Exit); Case DLG_ERR: MessageBox ("Unable to display custom dialog, installation cancel.", severe; abort; case dlg_init:; // Initialization, 啥 Case res_pbut_ok: // OK button Press the MessageBox ("The OK button is pressed.", Information; case res_pbut_next: MessageBox ("Next button is pressed.", Information; bdone = true; case res_pbut_back: messagebox (" The Back button is pressed. ", Information; bdone = true; endswitch;

Until bdone;

// Close the dialog endDialog (szdialogname);

/ / Release the memory ReleaseDialog (Szdialogname);

END;

3. Call dialog

Add #include "fbessssdialog.rul" exfn_definedialog (0); // call, this sentence is written according to the corresponding place as needed. For example, it will be displayed at the beginning, and it is written after the future onfirstuibefore (). Do you see the effect? Cool!

转载请注明原文地址:https://www.9cbs.com/read-66238.html

New Post(0)