Thread: [Dev-C++] ListBox selections
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Nathan S. <str...@ho...> - 2001-04-06 04:08:55
|
I have created a child window with WM_NOTIFY. Is there a way to have a message sent to my app? LBN_SELCHANGE isn't sent? I don't want to sent it, just receive some message. I am sure something like this has been posted somewhere but I haven't found it yet. |
|
From: Nathan S. <str...@ho...> - 2001-04-07 03:09:52
|
>
>
> > >
> > >
> > > > Opps, I do have the LBS_NOTIFY style but I never receive the
> > message. I am
> > > > processing it as a part of WM_COMMAND message
> > > >
> > >
> > > any know how?
> > >
> > > I have a listbox with LBS_NOTIFY style but my app receives no
> > messages when
> > > a user selects an item in the listbox.
> > >
> >
> > For me, a WM_COMMAND message is sent to the window procedure, with the
> > LBN_SELCHANGE notification code. So, to get more help, you will have
> > to post the part of the code where you process the WM_COMMAND message,
> > and maybe the code which creates the listbox. Somewhere there must be
> > a bug in your code.
> >
> > Elias Pschernig
> >
> >
hChildPB=CreateWindow("LISTBOX","",WS_CHILD | WS_CLIPSIBLINGS | LBS_NOTIFY
| WS_VSCROLL, 10,40,148,180,hwnd,NULL,g_hInst,0);
above is how I create it.
case WM_COMMAND:
switch( wParam )
{
case LBN_SELCHANGE:
MessageBox(hwnd,"it worked","I wish :(",MB_OK);
break;
then rest of my WM_COMMAND case which all works.
but the messagebox is never displayed.
|
|
From: Elias P. <eli...@ao...> - 2001-04-07 11:57:59
|
> > >
> hChildPB=CreateWindow("LISTBOX","",WS_CHILD | WS_CLIPSIBLINGS |
LBS_NOTIFY
> | WS_VSCROLL, 10,40,148,180,hwnd,NULL,g_hInst,0);
>
> above is how I create it.
>
>
> case WM_COMMAND:
> switch( wParam )
Well, this is the problem. According to the Win32 API docs, the
WM_COMMAND has the following parameters:
wNotifyCode = HIWORD(wParam); // notification code
wID = LOWORD(wParam); // control identifier
hwndCtl = (HWND) lParam; // handle of control
Just replace wParam by HIWORD(wParam) and everything should work.
> {
> case LBN_SELCHANGE:
> MessageBox(hwnd,"it worked","I wish :(",MB_OK);
> break;
>
> then rest of my WM_COMMAND case which all works.
>
> but the messagebox is never displayed.
Elias Pschernig
|
|
From: <jos...@ya...> - 2001-04-06 06:34:07
|
>>WM_NOTIFY. ?? This notification message applies only to a list box that has the LBS_NOTIFY style. hth Chemanuel --- Nathan Smith <str...@ho...> wrote: > I have created a child window with WM_NOTIFY. Is there a way to have > a > message sent to my app? LBN_SELCHANGE isn't sent? I don't want to > sent it, > just receive some message. I am sure something like this has been > posted > somewhere but I haven't found it yet. > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > http://lists.sourceforge.net/lists/listinfo/dev-cpp-users __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/ |
|
From: Nathan S. <str...@ho...> - 2001-04-06 06:51:07
|
Opps, I do have the LBS_NOTIFY style but I never receive the message. I am processing it as a part of WM_COMMAND message ----- Original Message ----- From: "Jose Manuel Padron Carrillo" <jos...@ya...> To: <dev...@li...> Sent: Friday, April 06, 2001 4:34 PM Subject: Re: [Dev-C++] ListBox selections > >>WM_NOTIFY. ?? > > This notification message applies only to a list box that has the > LBS_NOTIFY style. > > hth > > Chemanuel > > > --- Nathan Smith <str...@ho...> wrote: > > I have created a child window with WM_NOTIFY. Is there a way to have > > a > > message sent to my app? LBN_SELCHANGE isn't sent? I don't want to > > sent it, > > just receive some message. I am sure something like this has been > > posted > > somewhere but I haven't found it yet. > > > > _______________________________________________ > > Dev-cpp-users mailing list > > Dev...@li... > > http://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > __________________________________________________ > Do You Yahoo!? > Get email at your own domain with Yahoo! Mail. > http://personal.mail.yahoo.com/ > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > http://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: Nathan S. <str...@ho...> - 2001-04-06 22:23:10
|
> Opps, I do have the LBS_NOTIFY style but I never receive the message. I am > processing it as a part of WM_COMMAND message > any know how? I have a listbox with LBS_NOTIFY style but my app receives no messages when a user selects an item in the listbox. |
|
From: Pschernig <psc...@ao...> - 2001-04-06 22:36:17
|
> > > > Opps, I do have the LBS_NOTIFY style but I never receive the message. I am > > processing it as a part of WM_COMMAND message > > > > any know how? > > I have a listbox with LBS_NOTIFY style but my app receives no messages when > a user selects an item in the listbox. > For me, a WM_COMMAND message is sent to the window procedure, with the LBN_SELCHANGE notification code. So, to get more help, you will have to post the part of the code where you process the WM_COMMAND message, and maybe the code which creates the listbox. Somewhere there must be a bug in your code. Elias Pschernig |
|
From: Nathan S. <str...@ho...> - 2001-04-06 23:47:18
|
----- Original Message -----
From: "Pschernig" <psc...@ao...>
To: <dev...@li...>
Sent: Saturday, April 07, 2001 8:36 AM
Subject: Re: [Dev-C++] ListBox selections
> >
> >
> > > Opps, I do have the LBS_NOTIFY style but I never receive the
> message. I am
> > > processing it as a part of WM_COMMAND message
> > >
> >
> > any know how?
> >
> > I have a listbox with LBS_NOTIFY style but my app receives no
> messages when
> > a user selects an item in the listbox.
> >
>
> For me, a WM_COMMAND message is sent to the window procedure, with the
> LBN_SELCHANGE notification code. So, to get more help, you will have
> to post the part of the code where you process the WM_COMMAND message,
> and maybe the code which creates the listbox. Somewhere there must be
> a bug in your code.
>
> Elias Pschernig
>
>
hChildPB=CreateWindow("LISTBOX","",WS_CHILD | WS_CLIPSIBLINGS | LBS_NOTIFY
| WS_VSCROLL, 10,40,148,180,hwnd,NULL,g_hInst,0);
above is how I create it.
case WM_COMMAND:
switch( wParam )
{
case LBN_SELCHANGE:
itoa(10,TempText,10);
MessageBox(hwnd,TempText,TempText,MB_OK);
break;
then rest of my WM_COMMAND case which all works.
|