[Win Api]Problem with list box

Hello

I have some listbox with few elements. For example like this:

ListBox:
Name1
Name2


and now I want to get message from program when some element on the list has been double clicked. I know that ListBox send to owner WM_COMMAND and i found on MSD something like that:

LBN_DBLCLK

WPARAM wParam
LPARAM lParam;

wParam
The low-order word is the list box identifier.
The high-order word is the notification message.
lParam
Handle to the list box.

But I cannot understand how to use this in program. Can somebody show me example how to use this structure from MSDN in message loop?



this message will come in WM_COMMAND, see msdn for this.
if this is true then do this:

in WM_COMMAND,

if(HIWORD(wParam) == LBN_DBLCLK) //that means its a listbox click notification
{
if(lParam = (HWND)(hwnd of list box)) //this means the list box which you are expecting.
{
//write the handler here.
}
}

hope this will help.
where is the list box created?? becuase you may need to sub-class your list box.
Topic archived. No new replies allowed.