Archive: EnableWindow & SendMessage do nothing !


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


1. Dunno, sorry.
2. SendMessage $item ${WM_SETTEXT} 0 "STR:whatever"


2.
the error is:
SendMessage:warning: unknown variable/constant "{WM_SETTEXT}" detected


Ooooh. You need to !include "WinMessages.nsh" at the top of your script.


ok RobGrant thank you.
no error now!
but, as EnableWindow (first question - 1), SendMessage makes no change on controls.


That's because the inner window does not yet exist when the pre function is executed. Use the same code in the show function.


it's OK.
Thank you.