|
-
May 27th, 2002, 06:49 AM
#1
CListBox notification
Hi!
I have trouble making a CListBox notify its parent window when the selection is about to change (or, more, specifically, when an item is automatically selected by pressing a character key). The legacy code that creates the listbox looks like this:
CreateEx( WS_EX_TOOLWINDOW, _T("LISTBOX"), NULL,
WS_BORDER|WS_VSCROLL|WS_HSCROLL|WS_POPUP,
0,0,0,0, pParent, 0 );
I need to assign the listbox an ID to make it possible to use ON_LBN_SELCHANGE( ID_OF_MY_LISTBOX, MyHandler ) in the parent window to catch the event that the selection is about to change. But I can't. The CreateEx function fails if the last parameter isn't 0. Somewhere in the MFC code I get the error message "Invalid menu ID".
What am I to do to be able to catch the event I'm interested in?
Very greatful for any hints on how to do this.
Magnus
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|