cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
mirik222
Level 5

Handling ListView Control events with InstallScript

Hi all.

I've just finished creating ListView control in InstallScript.
It was quite easy.
It just required to send messages to create ListView, like LVM_INSERTCOLUMN,LVM_INSERTITEM,LVM_SETITEM.
and to send messages to get the text from the selected item:
nItemID = SendMessage(hListWnd, LVM_GETNEXTITEM, -1, LVIS_SELECTED);
nBuffSize = SendMessage(hListWnd, LVM_GETITEMTEXT, nItemID, &lvit);

But how to catch the ListView message when its selected item changes?
I tried to catch it with DefineDialog + DLG_MSG_ALL/DLG_MSG_CUSTOMCTRL but didn't get any message related to it.

Do you have any clue?
Labels (1)
0 Kudos
(1) Reply
mirik222
Level 5

Just to save your time, this code doesn't work:

#define LVN_FIRST (-100) // listview
#define LVN_ITEMACTIVATE (LVN_FIRST-14)

while (!bDone)
nId = WaitOnDialog( szDlg );
...
while(!PeekMessageA(&msg,hwndDlg,0,0,0))
if (msg.message = LVN_ITEMACTIVATE) then
SprintfBox(MB_OK,"","MESS=%d, HI=%d, LO=%d", msg.message, HIWORD(msg.wParam), LOWORD(msg.wParam));
endif;
endwhile;
...
endwhile;


Any other ideas?
0 Kudos