Results 1 to 1 of 1

Thread: Listbox Caption

Threaded View

  1. #1

    Thread Starter
    PowerPoster Halsafar's Avatar
    Join Date
    Jun 2004
    Location
    Saskatoon, SK
    Posts
    2,339

    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
    //------------------
    charListBox::Caption()
    {
        
    charszBuffer=0;
        
    charm_Text=0;

        
    LRESULT Index SendMessage(m_hwndLB_GETCURSEL,0,0);
        
    LRESULT iLength SendMessage(m_hwndLB_GETTEXTLEN,(WPARAM)Index,0);

        
    szBuffer = new char[iLength];

        
    GetWindowText(m_hwndszBufferiLength);

        
    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
  •  



Click Here to Expand Forum to Full Width