سؤال

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