-
SendMessage Not working
Alright, my SendMessage() is not working.
PHP Code:
Index = SendMessage(m_hwnd, LB_ADDSTRING, 0, (LPARAM)Item);
SendMessage(m_hwnd, LB_SETITEMDATA, Index, (LPARAM)Item);
The first SendMessage is suppose to return the index of the added string...Always 0, no matter what, which is wrong compared to other code I've seen.
PHP Code:
LRESULT Count = SendMessage(m_hwnd, LB_GETCOUNT,0,0);
LRESULT Index = SendMessage(m_hwnd, LB_GETSEL,0,0);
LRESULT iLength = SendMessage(m_hwnd, WM_GETTEXTLENGTH,(WPARAM)Index,0);
Both of those also always return 0, no matter how much data is on the listbox.
IT ALWAYS RETURNS 0....WHY? I'm searching msdn, gamedev, vbforums....and I am getting no where.
-
It is all because it is subclassed!!!!!!!!!!
If I remove the one line which subclass's the control, everything begins to work out just fine!
Why? How could this be?
Any suggestions.
I've been playing with how the box returns CallWindowProc and DefWindowProc in its subclassed....
It seems as if tho I have the listbox returning 1 for its index all the time!!