Skip to content
⌘ NSIS Forum Archive

EnableWindow & SendMessage do nothing !

7 posts

berrada#

EnableWindow & SendMessage do nothing !

have you some idea, thank you...

in the code below, the following calls don't work:
1. EnableWindow $item 0
--> do nothing
2. SendMessage $item {WM_SETTEXT} "..."
--> generate the error

Page directory preFunctionDirectory
Var hwnd
Var item
Function preFunctionDirectory
; [Get HWND current page of installation]
FindWindow $hwnd "#32770" "" $HWNDPARENT
; [Disable Directory field]
GetDlgItem $item $hwnd 1019 ; IDC_DIR
EnableWindow $item 0
SendMessage $item {WM_SETTEXT} "C:\SignallingServer\One"
; [Disable Directory GroupBox]
GetDlgItem $item $hwnd 1020 ; IDC_SELDIRTEXT
EnableWindow $item 0
; [Disable Browse... button]
GetDlgItem $item $hwnd 1001 ; IDC_BROWSE
EnableWindow $item 0
; [Disable label]
GetDlgItem $item $hwnd 1006 ; IDC_INTROTEXT
EnableWindow $item 0
FunctionEnd
berrada#
ok RobGrant thank you.
no error now!
but, as EnableWindow (first question - 1), SendMessage makes no change on controls.
kichik#
That's because the inner window does not yet exist when the pre function is executed. Use the same code in the show function.