Old 6th January 2005, 14:33   #1
berrada
Junior Member
 
Join Date: Jan 2005
Location: France - Paris
Posts: 7
Unhappy Add string in ComboBox (LB_ADDSTRING)

I need to add some strings in a ComboBox.
I think to use the SendMessage to this, but the Windows event LB_ADDSTRING don't exist in WinMessages.nsh

I added the following lignes in this file:
!define LB_ADDSTRING 0x180
!define LB_INSERTSTRING 0x181

and I write the following code:
; [Get HWND current page of installation]
FindWindow $hwnd "#32770" "" $HWNDPARENT
; [Disable Directory field]
GetDlgItem $item $hwnd 1019 ; IDC_DIR
SendMessage $item ${LB_ADDSTRING} "STR:line one"
SendMessage $item ${LB_ADDSTRING} "STR:line two"
SendMessage $item ${WM_SETTEXT} "STR:init value"

and it's not work !

help, please.
berrada is offline   Reply With Quote
Old 6th January 2005, 14:38   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
If it's a combo box, you need to use CB_ADDSTRING not LB_ADDSTRING. In both cases, the string should be passed in lParam, not wParam as in your example.

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, 15:13   #3
berrada
Junior Member
 
Join Date: Jan 2005
Location: France - Paris
Posts: 7
no change when I do:

SendMessage $item ${CB_ADDSTRING} 0 "STR:line one"
SendMessage $item ${CB_ADDSTRING} 0 "STR:line two"

NB:
I'v added the CB_ADDSTRING in WinMessages.nsh
!define CB_ADDSTRING 0x403
berrada is offline   Reply With Quote
Old 6th January 2005, 15:16   #4
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
CB_ADDSTRING is 0x0143 not 0x403. Additionally, it seems you're trying to use the message with a edit box, not a combo box. IDC_DIR is the id of the directory edit box.

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, 15:20   #5
berrada
Junior Member
 
Join Date: Jan 2005
Location: France - Paris
Posts: 7
Thumbs up

OK!
Precisely, I changes the IDC_DIR edit box by a combo box.
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