Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "WinAPI";
Текущий архив: 2004.02.13;
Скачать: [xml.tar.bz2];

Вниз

Как на 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 вся ветка

Форум: "WinAPI";
Текущий архив: 2004.02.13;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.44 MB
Время: 0.009 c
1-38807
Layner
2004-02-03 08:36
2004.02.13
Подскажите, как


4-39133
LK
2003-12-07 08:32
2004.02.13
Hook на работу с файлом


3-38676
Img
2004-01-22 17:08
2004.02.13
Выбор записей из нужной позиции.


8-38961
SergeyDon
2003-10-11 15:35
2004.02.13
ламерский вопрос: чем отличается использование OpenGL от DirectX?


1-38842
CTAPbIi
2004-01-29 11:49
2004.02.13
Эмуляция раскрытия списка в DBGrid





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский