Using InstallShield - InstallScript project:
I made a custom dialog for brow开发者_开发问答sing for a file.
On the dialog initialization I want to disable the "Next" button.
I am successful in disabling other buttons on this dialog except for any of the buttons of the install wizard: Cancel, Next and Back.
I used the functions _WinSubEnableControl or EnableWindow.
It works for me:
function
HWND hwndDlg, hwndNext;
...
begin
...
hwndDlg = CmdGetHwndDlg( strDialogName );
hwndCtrl = GetDlgItem(hwndDlg, NEXT);
EnableWindow(hwndCtrl, FALSE);
...
end;
If you didn't find this useful, please publish your code.
The code for disabling the button should be after the call to SdGeneralInit. If you put it before (like I did) the change won't stick.
The call to SdGeneralInit explicitly enables the "Next" button, that is why it did not work for the "Next" button but did work for the other custom buttons on the dialog.
It should look something like that:
case DLG_INIT:
SdGeneralInit( szDlg, hwndDlg, 0, szSdProduct );
hDlgHandle = CmdGetHwndDlg(szDlg);
hNextButton = GetDlgItem(hDlgHandle, 1); // 1 is the id for the next button.
EnableWindow(hNextButton, FALSE);
精彩评论