|
// *********************************************************
// コンボボックスから文字列を取得
// 戻り値 : 取得した文字列の長さ
// 戻り値 : エラーの場合は -1
// *********************************************************
int LboxCombobox::GetText( int nIndex, LboxString *LString )
{
int ret;
ret = (int)SendMessage(
LboxCombobox::hWnd,
CB_GETLBTEXTLEN,
(WPARAM)nIndex,
0L
);
if ( ret == CB_ERR ) {
return -1;
}
if ( (DWORD)(ret + 1) > LString->nLboxString ) {
LString->Resize( ret + 1 );
}
ret = (int)SendMessage(
hWnd,
CB_GETLBTEXT,
(WPARAM)nIndex,
(LPARAM)(LPCTSTR)LString->szLboxString
);
if ( ret == CB_ERR ) {
return -1;
}
return ret;
}
| |