문제

Using InstallShield - InstallScript project:

I made a custom dialog for browsing 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.

도움이 되었습니까?

해결책 2

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);

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top