Editing listbox data

This is a discussion on Editing listbox data within the Windows Programming forums, part of the Platform Specific Boards category; I looked through the listbox controls on MSDN and they don't seem to have some kind of message like this: ...

  1. #1
    Registered User
    Join Date
    Dec 2006
    Posts
    19

    Editing listbox data

    I looked through the listbox controls on MSDN and they don't seem to have some kind of message like this:
    Code:
    SendMessage((HWND)ListBox, LB_SETTEXT, LBindex, (LPARAM)AString);
    Easy question: So how do you edit a listbox item?
    Hard question: How do you figure out where in the memory your program is storing the string for the listbox item?

  2. #2
    Registered User
    Join Date
    Mar 2005
    Location
    Mountaintop, Pa
    Posts
    1,059
    How do you figure out where in the memory your program is storing the string for the listbox item?
    I'm not sure I fully understand this question.

    But anyway, unfortunately, there is no such animal as LB_SETTEXT. So, you may want to try the following LB edit implementation:

    Code:
    int iCurSel = SendMessage((HWND)lParam, LB_GETCURSEL, (WPARAM)0, 0L);
           	SendMessage((HWND)lParam, LB_INSERTSTRING, (WPARAM)(index), (LPARAM)"NewItem");
            SendMessage((HWND)lParam, LB_DELETESTRING, (WPARAM)(index+1), 0L);
            SendMessage((HWND)lParam, LB_SETCURSEL, (WPARAM)iCurSel, 0L);

  3. #3
    Registered User
    Join Date
    Dec 2006
    Posts
    19
    That's exactly what I'm trying to avoid.

    I know there's no such thing as LB_SETTEXT, but what I'm saying is there really should be.

    But if there really isn't, how do I go about where in the memory my program is storing the string for a listbox item?

  4. #4
    Registered User
    Join Date
    Mar 2005
    Location
    Mountaintop, Pa
    Posts
    1,059
    But if there really isn't, how do I go about where in the memory my program is storing the string for a listbox item?
    ReadProcessMemory is one way of finding out where your listbox strings are stored.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Lame null append cause buffer to crash
    By cmoo in forum C Programming
    Replies: 8
    Last Post: 12-29-2008, 03:27 AM
  2. simultaneously waiting for data on FIFO and UDP using select call
    By yogesh3073 in forum Networking/Device Communication
    Replies: 2
    Last Post: 01-05-2007, 09:53 AM
  3. Where's the EPIPE signal?
    By marc.andrysco in forum Networking/Device Communication
    Replies: 0
    Last Post: 12-23-2006, 08:04 PM
  4. Errors
    By Rhidian in forum C Programming
    Replies: 10
    Last Post: 04-04-2005, 01:22 PM
  5. Replies: 1
    Last Post: 11-23-2003, 08:51 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21