Drop-down (Combo Box)

stp's Avatar, Join Date: Feb 2008
stp
Light Poster
I want to do this.Two drop-down lists

First contains hard-disk drives on my computer




And the second drop-down i want to contains files in the drive that i choose in the first drop-down

Here are the files




I am using Visual Studio C++ 6.
Can you tell me or give me links how to scan hard disks on my computer and add them to the first drop-down then to see the files in this drive in the second drop-down
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Use GetLogicalDrives, which returns a DWORD that's a bitmask telling which drive letters are assigned. Bit 0 is drive A, bit 1 is drive B, and so on.
stp's Avatar, Join Date: Feb 2008
stp
Light Poster
10x.But i have a question.
This code scan for drivers.But how to add the strings to the combo box.How to show them?

Code:
int main()

{
		char buf[1000];
	DWORD buf_size, cnt;

	buf_size = GetLogicalDriveStrings(1000, buf);

	cout << "buf_size= " << buf_size << endl;



	cout << &buf[4] << endl;


	int i;
	for(i=0;i<buf_size;i=i+strlen(&buf[i])+1)
	{cout << &buf[i] << " ";}



	return 0;
}
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Depending on the number of bit set you need to add the character 'A' , 'B' as a string into the combo box.