UranusOne
4th August 2006 15:43 UTC
How to set enable/disable a Custom Button on a Custom Page?
* 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
* But for example, this commands not work on a
Custom Page on a
Custom Button:
- ; Supposedly Disable "Field 7" . Is a Button of $INI file.
GetDlgItem $1 $HWND 1206 ; PathRequest control (1200 + field 7 - 1)
EnableWindow $1 0
* How is the suitable way? :rolleyes:
------------------------------------
Afrow UK
4th August 2006 15:45 UTC
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
UranusOne
4th August 2006 23:31 UTC
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.
UranusOne
5th August 2006 00:13 UTC
Sorry, Here is Attached File...
engine
5th August 2006 00:44 UTC
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.
UranusOne
6th August 2006 06:39 UTC
I found the solution read This Topic.
The penultimate post of Afrow UK containing the real solution...
- ; * Disable item *
ReadINIStr $R7 "$INI" "Field 7" "HWND"
EnableWindow $R7 0
; * Enable item *
ReadINIStr $R7 "$INI" "Field 7" "HWND"
EnableWindow $R7 1
Thank you very much by everything...