Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Add item on combo box
Message
From
26/07/2000 03:40:14
 
 
To
25/07/2000 11:05:02
General information
Forum:
Visual C++
Category:
Other
Miscellaneous
Thread ID:
00396587
Message ID:
00396938
Views:
11
If you are using the vanilla Windows API you add a string by sending it a message. For example:-

SendMessage(hwndList, LB_ADDSTRING, 0, (LPARAM)"Hello Zaphod");

It is assumed that you have retrieved a handle to the listbox (hwndList) in the WM_INITDIALOG message of your dialog callback routine.

If you are using the Microsoft Foundation Classes then things are a lot easier. For example:-

m_ListBox.AddString("Hello Zaphod");

Again it is assumed that you have a dialog class to wrapper your dialog resource, and m_ListBox is a member variable of the class CListBox.

You can also insert strings by index rather than sorted.

HTH
Neil
Previous
Reply
Map
View

Click here to load this message in the networking platform