Clicking list box items and functions

This is a discussion on Clicking list box items and functions within the Windows Programming forums, part of the Platform Specific Boards category; I'm pretty new to all this programming stuff especially winapi. Well to get to it I was wondering if it ...

Clicking list box items and functions

I'm pretty new to all this programming stuff especially winapi. Well to get to it I was wondering if it is possible in c and winapi to call different functions by clicking the item text in a listbox. Sort of like using a list box as a menu. I found this code:

It just changes the window text to the selected item text, something like this could be useful to me now. If anyone could help me out with this, or recommend a tutorial or sample code. It would be appreciated.

Of course you will have to declare previously OPEN_FILE and SAVE_FILE (macro or enum). If you have also a standard menu you can set the list item values with the same menu item values, so instead of switch the selected item value you can simulate a menu click sending a WM_COMMAND and the list item value that will correspond to the same action on the standard menu.