combo box gets displayed successfully but How can I add the list of drives present in the computer I did this and my code complies with zero error and zero warning but I cannot see the strings added to my combo box
1 2 3 4 5 6 7 8 9 10 11 12 13
case WM_INITDIALOG:
wchar_t szDrives[MAX_PATH];
if (GetLogicalDriveStrings(MAX_PATH, szDrives))
{
wchar_t* pDrive = szDrives;
while (*pDrive)
{
SendMessage(drives, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(pDrive));
pDrive += wcslen(pDrive) + 1;
}
}
How can I add the drives present in the computer to the combo box present in my main window.
It does displays only the C drive I mean the first drive present in the computer.
What should I do now?
I did used copied this
SendMessage(GetDlgItem(hwndDlg, ID_COMBO), CB_SETCURSEL, (WPARAM)0, 0);
and pasted inside the loop but still I see only C:\ drive
I did used copied this
SendMessage(GetDlgItem(hwndDlg, ID_COMBO), CB_SETCURSEL, (WPARAM)0, 0);and pasted inside the loop but still I see only C:\ drive
No normally you set the current selection only when it is completely populated.
Normally you should see the other drives when you click on the arrow and the combobox drops down. You need to increase the height of the combobox if you can't see all drives.