I test deguix's code,but not work.These is my code
PHP Code:
Name "Test"
OutFile ".\test.exe"
Caption "Test"
SetCompressor lzma
ShowInstDetails show
!include MUI.nsh
Page custom SetCustom LeaveCustom
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE English
Section
SectionEnd
Function SetCustom
InstallOptions::initDialog /NOUNLOAD "$PLUGINSDIR\test2.ini"
Pop $9
InstallOptions::show
FunctionEnd
; --------------------------------------
!define CB_FINDSTRINGEXACT 0x0158
!define CB_SETCURSEL 0x014E
Function LeaveCustom
ReadINIStr $R0 "$PLUGINSDIR\test2.ini" Settings State
StrCmp $R0 0 validate
StrCmp $R0 2 droplist
Abort
droplist:
ReadINIStr $1 "$PLUGINSDIR\test2.ini" "Field 2" State
GetDlgItem $R1 $9 1200
SendMessage $R1 ${CB_FINDSTRINGEXACT} -1 $1 $0
SendMessage $R1 ${CB_SETCURSEL} $0 ""
;EnableWindow $R1 0
Abort
validate:
FunctionEnd
Function .onInit
InitPluginsDir
File "/oname=$PLUGINSDIR\test2.ini" ".\test2.ini"
FunctionEnd
And these is my ini file
PHP Code:
; Ini file generated by the HM NIS Edit IO designer.
[Settings]
NumFields=2
[Field 1]
Type=Droplist
Text=Droplist
State=1
ListItems=1|2|3
Left=61
Right=218
Top=6
Bottom=100
[Field 2]
Type=Droplist
Text=Droplist
Flags=NOTIFY
State=1
ListItems=1|2|3
Left=62
Right=220
Top=60
Bottom=151
I want droplist 2 control droplist 1.What wrong for me?