nsDialogs: disable a NSD_CreateBrowseButton
Hi,
I have the following code:
${NSD_CreateLabel} 0u 30u 89u 12u "Choose path:"
${NSD_CreateDirRequest} 90u 28u 180u 12u ""
Pop $INST_DIR
${NSD_CreateBrowseButton} 275u 26u 25u 16u ...
Pop $BROWSE_BUTTON
GetFunctionAddress $0 BrowseButtonAction
nsDialogs::OnClick /NOUNLOAD $BROWSE_BUTTON $0
[...]
${If} (some test)
StrCpy $R1 "${DEFAULT_INSTDIR}"
${Else}
${NSD_ENABLE} $INST_DIR 0
${NSD_ENABLE} $BROWSE_BUTTON 0
StrCpy $R1 ""
${EndIf}
SendMessage $INST_DIR ${WM_SETTEXT} 0 STR:$R1
I want to disable the browse button (no action when pressed). The NSD_ENABLE macro -which comes from this very helpful example- doesn't work on my BrowseButton $BROWSE_BUTTON.... but work on the DirRequest $INST_DIR... any idea ?
Here the macro def:
!macro _NSD_ENABLE NAME TOGGLE
SendMessage ${NAME} ${WM_ENABLE} ${TOGGLE} 0 $R0
Push $R0
!macroend
!define NSD_ENABLE `!insertmacro _NSD_ENABLE`
I know that I can just move the OnClick function assignment into the If clause to fix this issue, but wanna understand why it doesn't work.
Gal'