Beispiel #1
0
LRESULT CComboBox::GetLBText(int index, UString &s)
{
  s.Empty();
  if (g_IsNT)
  {
    LRESULT len = SendMsgW(CB_GETLBTEXTLEN, index, 0);
    if (len == CB_ERR)
      return len;
    LRESULT len2 = SendMsgW(CB_GETLBTEXT, index, (LPARAM)s.GetBuf((unsigned)len));
    if (len2 == CB_ERR)
      return len;
    if (len > len2)
      len = len2;
    s.ReleaseBuf_CalcLen((unsigned)len);
    return len;
  }
  AString sa;
  LRESULT len = GetLBText(index, sa);
  if (len == CB_ERR)
    return len;
  s = GetUnicodeString(sa);
  return s.Len();
}
Beispiel #2
0
LRESULT CComboBox::AddString(LPCWSTR s)
{
  if (g_IsNT)
    return SendMsgW(CB_ADDSTRING, 0, (LPARAM)s);
  return AddString(GetSystemString(s));
}
Beispiel #3
0
 INT CAnyWindow::GetTextLengthW() const
 {
   return ( (INT) SendMsgW(WM_GETTEXTLENGTH, 0, 0) );
 }
Beispiel #4
0
 BOOL CAnyWindow::SetTextW(const WCHAR* cszText)
 {
   return ( SendMsgW(WM_SETTEXT, 0, (LPARAM) cszText) == TRUE );
 }
Beispiel #5
0
 INT CAnyWindow::GetTextW(WCHAR* lpTextBuf, INT nTextBufSize)
 {
   return ( (INT) SendMsgW(WM_GETTEXT,  
     (WPARAM) nTextBufSize, (LPARAM) lpTextBuf) );
 }