Archive: SendMessage, comboBox and cb_settext


SendMessage, DropList and settext
  Hello,

I want to have a blank in a dropList, I try to use SendMessage but nothing changes.

This is my code :

GetDlgItem $1 $hwnd 1202
SendMessage $1 ${CB_SETTEXT} 0 "STR:"

Have you got an idea?
Thanks

PS:Sorry, I can't change the subject, it's not combobox but droplist


What do you mean like a blank? Do you mean like space between strings?


Yes, in my dropList, the first line is a space. The user can choose an other line and with a button "clear", he can clear all controls and I would like the dropList with the first line. I hope you understand me, I must use more my english so for the moment, it's a little hard for me to explain :(

Thanks


Well... I suposse to insert blank lines in droplist...

!define CB_INSERTSTRING 0x014A

GetDlgItem$1 $hwnd 1202
SendMessage$1 ${CB_INSERTSTRING} 0 ""
>SendMessage $1 ${CB_INSERTSTRING} 1 "Line1"
>SendMessage $1 ${CB_INSERTSTRING} 2 ""
>SendMessage $1 ${CB_INSERTSTRING} 3 "Line2"
Warning: Didn't test the code with NSIS syntax

Thanks but I have a memory problem when I use this code...
And I think I wasn't be good in my explanations.
This is my dropList :
- blank
- line1
- line2

The user chose the line2 so he can see the dropList with line2.
With a 'clear' button, he can reset all controls so, I would like the user see the dropList with blank.

Thanks


Thanks to Joel, he drived me in the good way.

I need CB_SETCURSEL in my SendMessage, and now, it's perfect :up:


Oh..you wanted a pre-selected option? :D