Вниз
Скачать: CL | DM;

Как на WinAPI заполнить ComboBox   Найти похожие ветки 

 
vasil   (2003-12-09 13:00) [0]

Подскажите плз как заполнить моей программой ComboBox двумя строками. ComboBox создан в другой программе известно название программы и её заголовок но не известен дескриптор окна.


 
Dimaxx ©   (2003-12-10 01:42) [1]

An application sends a CB_ADDSTRING message to add a string to the list box of a combo box. If the combo box does not have the CBS_SORT style, the string is added to the end of the list. Otherwise, the string is inserted into the list, and the list is sorted.

CB_ADDSTRING
wParam = 0; // not used; must be zero
lParam = (LPARAM) (LPCTSTR) lpsz; // address of string to add

Parameters

lpsz

Value of lParam. Points to the null-terminated string to be added. If you create the combo box with an owner-drawn style but without the CBS_HASSTRINGS style, the value of the lpsz parameter is stored as item data rather than the string it would otherwise point to. The item data can be retrieved or modified by sending the CB_GETITEMDATA or CB_SETITEMDATA message.

Return Values

The return value is the zero-based index to the string in the list box of the combo box. If an error occurs, the return value is CB_ERR. If insufficient space is available to store the new string, it is CB_ERRSPACE.

Remarks

If you create an owner-drawn combo box with the CBS_SORT style but without the CBS_HASSTRINGS style, the WM_COMPAREITEM message is sent one or more times to the owner of the combo box so the new item can be properly placed in the list.
To insert a string at a specific location within the list, use the CB_INSERTSTRING message.

See also CB_DIR, CB_INSERTSTRING, WM_COMPAREITEM


 
vasil   (2003-12-10 04:53) [2]

спасибо за понятный и полный ответ



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.022 c
14-39046
_none_
2004-01-27 12:04
2004.02.13
Беспроигрышная лотерея! автомобиль в каждом билете!


8-38965
AlexT1000
2003-09-04 12:00
2004.02.13
Как получить каждый кадр с Web камеры в память?


1-38929
turonix
2004-02-04 11:53
2004.02.13
Как из функции вне класса запустить обработчик события в классе?


14-39069
Joker
2004-01-21 22:52
2004.02.13
Проблема, блин!!!


1-38858
dima_crt
2004-02-02 10:26
2004.02.13
ActivateHint




   Наверх