c++ - How to send these items in the combo box -
i have created combo box in program. have function named add() adds files drive specified.
i searched google on how list of drives present in computer, , found this:
dword var1 = 100; wchar storevalue[100]; dword drives = getlogicaldrivestrings(var1, storevalue); (int = 0;i < 100;i++) { return 0; } i want add drives present in computer combo box, function can add files specified drive. how can this? quiet tricky beginner.
i aware easier when create browse drive wish in combo box.
getlogicaldrivestrings fills buffer double-null terminated array of strings. can iterate through this, stopping when first character of "next" string null.
wchar_t szdrives[max_path]; if (getlogicaldrivestrings(max_path, szdrives)) { wchar_t* pdrive = szdrives; while (*pdrive) { // pdrive // jump next pdrive += wcslen(pdrive) + 1; } } now "do pdrive" can in case add string combo box:
sendmessage(hwndcombo, cb_addstring, 0, reinterpret_cast<lparam>(pdrive));
Comments
Post a Comment