Hello folks,

According to Win32 Programmer's Reference, LBN_DBCLICK message is sent to the parent window of a listbox (i.e. dialogbox?) when user double-clicks a string in the list box. It is also mentioned that this message is sent through the WM_COMMAND.
My problem is, that i can't respond to this message as the dialog box seems not to recieve it at all. Below is a snippet from my little proggie. Please don't look at style of coding and tell me what I am doing wrong. I'll have to add that listbox has LBS_NOTIFY style so everything shoud be OK, but it isn't :( (probably my fault). Regards

MainDlgProc proc hWnd:DWORD,uMsg:DWORD,wParam:DWORD,lParam:DWORD
.elseif uMsg == WM_COMMAND
mov eax, wParam
.if eax == IDB_EDYTUJ ; from *.res file
(some operations)
.elseif eax == IDB_WYJSCIE ; Exit button
invoke SendMessage, hWnd, WM_CLOSE, 0, 0
.elseif eax == LBN_DBLCLK ; should happen when user clicked twice on a string in listbox.
invoke MessageBoxA, 0, addr szDBClicked, addr szInfo, MB_OK
.if eax == LB_ERR
int 3 ; for testing purposes only

xor eax, eax
Posted on 2002-07-31 17:14:05 by slonik
Hi slonik,

LBN_DBCLK is notify message, first you must convert wParam to notify,

mov eax,wParam
shr eax,16
cmp eax, LBN_DBLCLK

have nice days,
Posted on 2002-07-31 18:20:23 by CYDONIA
If you are thinking of something like this :

.elseif uMsg == WM_COMMAND
mov eax, wParam
shr eax, 16
.if eax == LBN_DBLCLK
int 3

It doesn't work (at least in my case) :(
Posted on 2002-08-01 06:19:48 by slonik
From MSDN:


This message is sent only by a list box that has the LBS_NOTIFY style.
Posted on 2002-08-01 07:43:39 by japheth
Now it works. I thought I have set LBS_NOTIFY flag while creating *.res file, but i hadn't. Using Restorator is sometimes weird :). Thanks.
Posted on 2002-08-01 13:05:04 by slonik