I am making a program. How do I make a drop-down box that lists the files on e:\(or d:\) drives? And how do I tell what the user selects?
I am making a program. How do I make a drop-down box that lists the files on e:\(or d:\) drives? And how do I tell what the user selects?
With the WIN32 API (VISUAL C no++) using MS DevStudio
In Dropdown style combobox
Process WM_COMMAND messages using a switch to the combobox ID
eg
case COMBOBOX:
if(HIWORD(wParam)==CBN_SELCHANGE)
will tell you if the user has clicked a new item
A treeview would be better than a dropdown list for a list of ALL files.
Process WM_NOTIFY messages in the CALLBACK looking for TVN_SELCHANGED messages for the treeview ID
eg
case TREEVIEW:
NMTree = (NM_TREEVIEW FAR *) lParam;
if(TVN_SELCHANGED==NMTree->hdr.code)
I think there is a special FLAG to set if you want the treeview to list all files on a drive but I can't find it.