Old 6th January 2005, 13:14   #1
berrada
Junior Member
 
Join Date: Jan 2005
Location: France - Paris
Posts: 7
Unhappy 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 is offline   Reply With Quote
Old 6th January 2005, 13:16   #2
RobGrant
Senior Member
 
Join Date: Sep 2004
Location: Nottingham
Posts: 263
1. Dunno, sorry.
2. SendMessage $item ${WM_SETTEXT} 0 "STR:whatever"
RobGrant is offline   Reply With Quote
Old 6th January 2005, 13:35   #3
berrada
Junior Member
 
Join Date: Jan 2005
Location: France - Paris
Posts: 7
2.

the error is:
SendMessage:warning: unknown variable/constant "{WM_SETTEXT}" detected
berrada is offline   Reply With Quote
Old 6th January 2005, 13:42   #4
RobGrant
Senior Member
 
Join Date: Sep 2004
Location: Nottingham
Posts: 263
Ooooh. You need to !include "WinMessages.nsh" at the top of your script.
RobGrant is offline   Reply With Quote
Old 6th January 2005, 13:51   #5
berrada
Junior Member
 
Join Date: Jan 2005
Location: France - Paris
Posts: 7
Thumbs up

ok RobGrant thank you.
no error now!
but, as EnableWindow (first question - 1), SendMessage makes no change on controls.
berrada is offline   Reply With Quote
Old 6th January 2005, 13:53   #6
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
That's because the inner window does not yet exist when the pre function is executed. Use the same code in the show function.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 6th January 2005, 14:05   #7
berrada
Junior Member
 
Join Date: Jan 2005
Location: France - Paris
Posts: 7
Wink

it's OK.
Thank you.
berrada is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump