Skip to content
⌘ NSIS Forum Archive

disable Browse Button

3 posts

Tslim#

disable Browse Button

hi,

i try to disable Browse Button when my direction page is loaded. i put this in my code:


!define MUI_PAGE_CUSTOMFUNCTION_PRE dirpre
!insertmacro MUI_PAGE_DIRECTORY
Function dirpre
FindWindow $R0 "#32770" "" $HWNDPARENT
GetDlgItem $R1 $R0 1019
EnableWindow $R1 0
FindWindow $R0 "#32770" "" $HWNDPARENT
GetDlgItem $R1 $R0 1001
EnableWindow $R1 0
FunctionEnd

but it does'nt works.
thanks for your help
Afrow UK#
The Pre function is called before the page is shown.
Use your code in the Show function.

!define MUI_PAGE_CUSTOMFUNCTION_SHOW dirshow
!insertmacro MUI_PAGE_DIRECTORY
Function dirshow
FindWindow $R0 "#32770" "" $HWNDPARENT
GetDlgItem $R1 $R0 1019
EnableWindow $R1 0
GetDlgItem $R1 $R0 1001
EnableWindow $R1 0
FunctionEnd
No need for two FindWindow instructions either.

-Stu