cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
xsintill
Level 5

determine custom dialog name

i made a dialog using the dialogs view in the installation designer. This is shown like i want it too.
This dialog has it's next button disabled. When the user pushes a button the next button can be enabled again. Now i come across some codes which can do this but I have trouble with getting the handle for the dialog. for this i use CmdGetHwndDlg. As a parameter it needs the name of the dialog. I have put the name in there but i get -1 as a handle. So i presume i have the wrong name for the dialog.
Anybody know how i can find out what name i should use? or can't i use CmdGetHwndDlg with custom dialogs made the way i did?
Labels (1)
0 Kudos
(5) Replies
RobertDickau
Flexera Alumni

Assuming this is an InstallScript or InstallScript MSI project: The dialog name to use in CmdGetHwndDlg is the same one used in the EzDefineDialog, WaitOnDialog, EndDialog, and ReleaseDialog functions. If matching that up doesn't work, perhaps post an outline of the dialog-processing code?
0 Kudos
xsintill
Level 5

robert thanks for repsonding. I don't use any of those functions. Maybe they are generated automatically when you make a dialog in the installshield user interface? if so how can is see the generated code behind such a dialog?
0 Kudos
xsintill
Level 5

btw. i used the same name as you can see in the dialog view under the all dialogs view. forget to tell i use a basic msi project
0 Kudos
RobertDickau
Flexera Alumni

Oh, those functions apply only to InstallScript-based dialog boxes. For Basic MSI, you can enable and disable controls using the Conditions tab in the Behavior node for your dialog box.

The LicenseAgreement dialog box is a good model for seeing what to do...
0 Kudos
xsintill
Level 5

Thanks Robert that looks a lot easier and less error prone then my solution:
function EnableControl(ButtonControlId,ControlOn) 
LONG hwndDlg,hwndItem;
begin
hwndDlg = FindWindow("MsiDialogCloseClass","");
hwndItem = GetDlgItem(hwndDlg, ButtonControlId);
EnableWindow(hwndItem, ControlOn);
end;
0 Kudos