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
- :
- Re: Changing a control's property.
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
‎Jun 15, 2009
02:31 PM
Changing a control's property.
This is an EXE, not an MSI..
I've looked through help and I guess I'm just missing it. How do I change a control's property/attribute?
For example I have check boxes and radio buttons. I'm checking registry and if there is a specific value, I'm wanting to disable one of the check boxes and one of the radio buttons. I see they both have an enable properties, but I'm not finding how to change them on the fly.
I found SetProperty, but that doesn't seem to be a function so I'm unsure how to use it. Would have been nice if the third parm of CtrlSetState() was an INT instead of a BOOL so that it could handle more than just check state.
I've looked through help and I guess I'm just missing it. How do I change a control's property/attribute?
For example I have check boxes and radio buttons. I'm checking registry and if there is a specific value, I'm wanting to disable one of the check boxes and one of the radio buttons. I see they both have an enable properties, but I'm not finding how to change them on the fly.
I found SetProperty, but that doesn't seem to be a function so I'm unsure how to use it. Would have been nice if the third parm of CtrlSetState() was an INT instead of a BOOL so that it could handle more than just check state.
(7) Replies
‎Jun 15, 2009
02:43 PM
Right, CtrlSetState is just for selecting and clearing check boxes and radio buttons. To enable and disable a control, you can use EnableWindow (search these forums and the dialog source code); and to hide and show you can use ShowWindow.
‎Jun 15, 2009
03:09 PM
Searching through looking for EnableWindow I saw someone post about _WinSubEnableControl(). That seems to work nicely. Is there a difference between the two and is there are reason to use one over the other?
_WinSubEnableControl (hwndDlg, INSTALL_TYPE_CHECK_INSTALL_CONSOLE, 0);
I can't seem to get EnableWindow to work. I'm unable to find any example code so I know it's params, but I guessed based on ShowWindows it (HWND, 0/1). Doesn't error, but doesnt seem to do anything either.
Is there a version of _WinSubEnableControl for Show and Hide as well?
_WinSubEnableControl (hwndDlg, INSTALL_TYPE_CHECK_INSTALL_CONSOLE, 0);
I can't seem to get EnableWindow to work. I'm unable to find any example code so I know it's params, but I guessed based on ShowWindows it (HWND, 0/1). Doesn't error, but doesnt seem to do anything either.
Is there a version of _WinSubEnableControl for Show and Hide as well?
‎Jun 15, 2009
03:25 PM
I found how to use it..
hwndItem = GetDlgItem( hwndDlg, nControlID );
So, that seems a lot of extra steps. Seems to me that _WinSubEnableControl would be a better use, or is it?
I'm still searching for the Show Hide version of _WinSubEnableControl
hwndItem = GetDlgItem( hwndDlg, nControlID );
So, that seems a lot of extra steps. Seems to me that _WinSubEnableControl would be a better use, or is it?
I'm still searching for the Show Hide version of _WinSubEnableControl
‎Jun 15, 2009
03:28 PM
They're essentially the same. EnableWindow is the direct Windows API call, while the _WinSub version saves you the trouble of a separate call to GetDlgItem.
P.S. Winsub.rul suggests there's a _WinSubShowWindow function, but I haven't used it (I tend to use GetDlgItem and ShowWindow).
P.S. Winsub.rul suggests there's a _WinSubShowWindow function, but I haven't used it (I tend to use GetDlgItem and ShowWindow).
‎Jun 15, 2009
03:35 PM
Thanks.. _WinSubShowWindow() seems to be the same as ShowWindow(). I still have to call GetDlgItem() to use it.
hCtrl = GetDlgItem(hwndDlg, INSTALL_TYPE_CHECK_INSTALL_CONSOLE);
//_WinSubShowWindow(hCtrl, 0);
ShowWindow(hCtrl, 0);
Is there a list somewhere of all API's in InstallShield? If there were it would save a lot of time just searching for Enable and seing what comes up..
Kind of like VB6 and their TXT file with all the Windows API Declarations.. That would be awsome.
hCtrl = GetDlgItem(hwndDlg, INSTALL_TYPE_CHECK_INSTALL_CONSOLE);
//_WinSubShowWindow(hCtrl, 0);
ShowWindow(hCtrl, 0);
Is there a list somewhere of all API's in InstallShield? If there were it would save a lot of time just searching for Enable and seing what comes up..
Kind of like VB6 and their TXT file with all the Windows API Declarations.. That would be awsome.
‎Jun 15, 2009
03:40 PM
The Winsub.h header file shows the handful of pre-prototyped generic Windows API functions.
‎Jun 15, 2009
03:43 PM
Only 19 IS function in there, but thats a good start. Exactly what I'm looking for.