This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- How to set button visibility via setup.rul?
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 18, 2021
03:25 AM
How to set button visibility via setup.rul?
How to set button visibility via setup.rul?
I have a button defined in a customized welcome dialog (via Dialog View) and need to change the button visibility due to a preprocessor variable is set.
(3) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 18, 2021
08:03 AM
Hello,
You can use the ShowWindow function:
https://docs.revenera.com/installshield26helplib/LangRef/LangrefShowWindow.htm
Example:
Show/Hide utility function:
prototype Dlg_HideControl( byval NUMBER, // hDlg - handle for the dialog
byval NUMBER, // nControlID - ID of the control to show/hide
byval BOOL // bState - whether to hide (1) or show (0) the control
);
//---------------------------------------------------------------------------
// third argument determines whether to hide (1) or show (0) the control
function Dlg_HideControl( hDlg, nControlID, bState )
NUMBER hCtrl;
BOOL bResult;
begin
hCtrl = GetDlgItem( hDlg, nControlID );
if bState then
ShowWindow( hCtrl, SW_HIDE );
else
ShowWindow( hCtrl, SW_SHOW );
endif;
end;
Usage (in dialog .rul file):
// insert before ShowDialog_xyz function
#define DLG_Dokumente 552
// add to ShowDialog_xyz variables if missing
HWND hDlg
// call from within the ShowDialog_xyz function
Dlg_HideControl( hDlg, DLG_Dokumente, Preprocessor_Variable_as_Boolean );
HTH
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 19, 2021
01:11 AM
Thanks, but how do I get the hDlg from a sdWelcome dialog?
I guess with CmdGetHwndDlg(szDialogName) but what is the dialog name to use?