Archive: How to set enable/disable a Custom Button on a Custom Page?


How to set enable/disable a Custom Button on a Custom Page?
* This commands set enabled or disabled de next button:



* But for example, this commands not work on a Custom Page on a Custom Button:


* How is the suitable way? :rolleyes:
------------------------------------

That will work for Button controls. If you want to disable the button of a DirRequest control, then the control ID is one greater (so it's 1207).

You need to use the code between the InitDialog and Show InstallOptions calls.

-Stu


These commands are executed in the Function LeaveCustom, after Function ShowCustom and Work.

Originally posted by Me
[B]* This commands set enabled or disabled de next button:
  • ; Disable "Next" button.
    GetDlgItem $1 $HWNDPARENT 1
    EnableWindow $1 0
  • ; Enable "Next" button.
    GetDlgItem $1 $HWNDPARENT 1
    EnableWindow $1 1
Depending conditionally of the parameters that are obtained according to two DirRequest fields, NEXT button is activate or not.

I would like to do the same with the CustomButton ClearFields for the two DirRequest Fields, but I cannot find the way to obtain $HWND of he himself.

For that reason it asked if it were well before this.

I could not found information as well as either examples, on like the state of a DirRequest Field, do make enabled or disabled a CustomButton. Single I found information on this for next Button.

I Attached 2 files on a Zip, CopyFolderTo.nsi and CopyFolderTo.ini.

Sorry, Here is Attached File...


Try:
ReadINIStr $1 "$INI" "Field 3" HWND2

If it does work,View "yournsisdir\Docs\InstallOptions\readme.htm" for detail.

Note in IO Plug-in's Changelog.txt:
DLL version 2.44 (10/11/2005)
* Added HWND and HWND2 entries to the INI file to avoid messy calculations of the correct control id
Watch the $INI file while your installer is running to make it lucid.

Hope it helps.

I found the solution read This Topic.

The penultimate post of Afrow UK containing the real solution...



Thank you very much by everything...