Disabling FileRequest textfield
Hi guys
I want to disable a FileRequest textfield, while leaving the browse button available for use. Looking in testnotify.nsi, I see that to fully disable the FileRequest, you must do this:
ReadINIStr $0 "$PLUGINSDIR\test.ini" "Field 2" "State"
GetDlgItem $1 $hwnd 1204 ; PathRequest control (1200 + field 5 - 1)
EnableWindow $1 $0
GetDlgItem $1 $hwnd 1204 ; ... button (the following control)
EnableWindow $1 $0
But...what's going on here? I seem to be getting the same dialog item twice, but it's presumably once referring to the textfield, and then to the browse button.
Fair enough. I try it:
Pop $hwnd ;HWND of dialog
GetDlgItem $1 $hwnd 1202
EnableWindow $1 0
GetDlgItem $1 $hwnd 1202
EnableWindow $1 1
GetDlgItem $1 $hwnd 1203
EnableWindow $1 0
GetDlgItem $1 $hwnd 1203
EnableWindow $1 1
The FileRequests I want to modify are Fields 3 & 4, so 1202 and 1203 should do it. Do they?
No. :) It does nothing.
Any ideas? Am I missing something obvious?
Thanks!