Article View: comp.os.os2.programmer
Article #2015Re: Receiving LN_ENTER with a LS_MULTIPLESEL listbox?
From: Larry Salomon Jr.
Date: Mon, 12 Oct 1992 13:50
Date: Mon, 12 Oct 1992 13:50
29 lines
1841 bytes
1841 bytes
In <Bvwts7.EIF@news.cso.uiuc.edu> cjs33278@uxa.cso.uiuc.edu (Carl+Chris Samos) writes: > <stuff deleted> >The problem is this: When I receive the LN_ENTER code, I need to know which >item was double clicked. Since it's multiple selection, other items in the >listbox may be selected, so you can't just send an LM_QUERYSELECTION >message to the listbox. That will return the first selected item, or the >next selected item, if you send multiple LM_QUERYSELECTION messages. >Any ideas on how to accomplish this? I spent about 2 hours last night, and >I found a solution, but I'm interested to hear if anybody else has any ideas >on how to do it. I'll post my solution if anyone is interested. The only easy way that I can think of would be to store a selection-state flag in the item handle for each listbox item. When you receive an LN_SELECT or LN_ENTER message, repeatedly send LM_QUERYSELECTION messages to the listbox to query all of the selected items and compare each with the selection state. The one item that is returned from LM_QUERYSELECTION but whose flag is FALSE is the one that was selected. If you need more help regarding this, let me know offline. Cheers, Q -- "If you choose not to decide, you | "A fool and his money are fun to go still have made a choice" - Rush | out with" - seen on a T-shirt ------------------------------------------------------------------------
Technical Details
Message-ID:
<1992Oct12.135020.2369@panix.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!newsgate.watson.ibm.com!news.ans.net!cmcl2!panix!os2manReferences:
<Bvwts7.EIF@news.cso.uiuc.edu>Show Full Headers
Complete Article Headers
Newsgroups: comp.os.os2.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!newsgate.watson.ibm.com!news.ans.net!cmcl2!panix!os2man From: os2man@panix.com (Larry Salomon Jr.) Subject: Re: Receiving LN_ENTER with a LS_MULTIPLESEL listbox? Message-ID: <1992Oct12.135020.2369@panix.com> Date: Mon, 12 Oct 1992 13:50:20 GMT References: <Bvwts7.EIF@news.cso.uiuc.edu> Organization: PANIX Public Access Unix, NYC Lines: 29