I am new to the win32 api and need help trying to understand how the GetLogicalDrives() function works. I am trying to populate a cbs_dropdownlist with all the available drives that are not in use. here is what I have so far. I would appreciate any help.
void FillListBox(HWND hWndDropMenu)
{
DWORD drives = GetLogicalDrives();
for (int i=0; i<26; i++)
{
SendMessage(hWndDropMenu, CB_ADDSTRING, 0, (LPARAM)drives);
}
}
The function
GetLogicalDrivesreturns a bitmask of the logical drives available. Here is how you would do it:The code checks whether the i-th bit in the bitmask is not set to
1ortrue.