|
-
Oct 31st, 2004, 01:28 AM
#1
Thread Starter
PowerPoster
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.
Last edited by Halsafar; Oct 31st, 2004 at 01:42 AM.
"From what was there, and was meant to be, but not of that was faded away." - - Steve Damm
"The polar opposite of nothingness is existance. When existance calls apon nothingness it shall return to nothingness." - - Steve Damm
"When you do things right, people won't be sure if you did anything at all." - - God from Futurama
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|