• LN_SELECT in list box with multiple selection

    From nwoodr@gmail.com@21:1/5 to All on Thu Apr 4 16:38:27 2019
    On Monday, December 9, 2013 at 4:29:50 PM UTC-5, Marcel Müller wrote:
    I have a listbox with style LS_MULTISEL|LS_EXTENDEDSEL and get a
    WM_CONTROL message with LN_SELECT. How do I examine what item recently
    has been selected or deselected? The documentation says one should use LM_QUERYSELECTION, but this does not reflect the recent changes.


    I know that this is a very old question but I wanted to give a straight answer since one was not posted and someone might come looking for an answer...

    You need to start by defining a select index, it needs to be signed...

    SHORT sSelectIndex;

    To find the first item selected you need to set sSelectIndex to return the first item selected...

    sSelectIndex = LIT_FIRST;

    Then you loop through the lmquery until sSelectIndex is equal LIT_NONE...

    while ((sSelectIndex = (USHORT)(ULONG)WinSendMsg(hWndLstBox,
    CHAR szText[256];
    // query list box item for text
    LM_QUERYITEMTEXT, MPFROM2SHORT(sSelectIndex, sizeof(szText)),


    I hope someone finds this answer.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)