-
Listbox Caption
I am creating a caption return like in VB for listbox's...
EDIT: Any SendMessage to this control result in 0.
PHP Code:
//------------------
//Retrieve caption from the control
//------------------
char* ListBox::Caption()
{
char* szBuffer=0;
char* m_Text=0;
LRESULT Index = SendMessage(m_hwnd, LB_GETCURSEL,0,0);
LRESULT iLength = SendMessage(m_hwnd, LB_GETTEXTLEN,(WPARAM)Index,0);
szBuffer = new char[iLength];
GetWindowText(m_hwnd, szBuffer, iLength);
m_Text = szBuffer;
delete szBuffer;
return m_Text;
}
Problem is, the two SendMessage calls both return 0 no matter what. With many items, all selected, etc, all return 0...it is kinda stupid.
Now I aint sure if I did that right I aint the best with char bufferin properly...I think I need to add one for the null. That aint my problem.