Главная страница
    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.45 MB
Время: 0.011 c
1-38943
killer
2004-01-23 13:37
2004.02.13
Scroll в Memo


6-38981
XFree
2003-12-11 09:57
2004.02.13
Создание городской сети


14-39032
Dmitriy O.
2004-01-26 11:10
2004.02.13
Присутствие программистов на Марсе необходимо !


7-39111
KyRo
2003-11-27 00:41
2004.02.13
Платформа Microsoft.Net


1-38874
MadGhost
2004-02-04 21:46
2004.02.13
Как форму во время выполнения функции заставить на себе отображат





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
Английский Французский Немецкий Итальянский Португальский Русский Испанский