jeffmcln5
March 29th, 2004, 04:27 AM
Hello,
I'm trying to retrieve the contents of the folder "\My Bluetooth Places\Entire Bluetooth Neighborhood" to see my local Bluetooth devices. I can use the Shell class to access teh "My Bluetooth Places" folder, but the Items collection is empty (which is wrong--it *does* contain "Entire Bluetooth Neighborhood"). If I call BrowseForFolder it lists the folder correctly and I can pick it. But, if you see how many children it's parent contains, it says it's 0. What??? How can your parent not have any children? That's got to be a bug, right?
Also, once you find the Bluetooth device, it has a property "Mac Address" (you can right click on it in explorer and choose properties to see it). Is there any way to get this value programatically?
Here's a C# code snippet:
Shell32.ShellClass shell = new Shell32.ShellClass();
// This will bring up a Folder browser. Pick "\My Bluetooth Places\Entire Bluetooth Neighborhood"
Shell32.Folder fEntire_Bluetooth_Neighborhood =
shell.BrowseForFolder(0,"Pick Entire Bluetooth Neighboorhood",0,null);
Shell32.Folder fMy_Bluetooth_Places = fEntire_Bluetooth_Neighborhood.ParentFolder;
// Now fMy_Bluetooth_Places points to My Bluetooth Places
// and fEntire_Bluetooth_Neighborhood points to My Bluetooth Places\Entire Bluetooth Neighborhood
Shell32.FolderItems childItems = fMy_Bluetooth_Places.Items(); // take the child folder, see how many items the parent contains
int Count = childItems.Count; // Count is 0. How's that possible? My parent has no children?
I'm trying to retrieve the contents of the folder "\My Bluetooth Places\Entire Bluetooth Neighborhood" to see my local Bluetooth devices. I can use the Shell class to access teh "My Bluetooth Places" folder, but the Items collection is empty (which is wrong--it *does* contain "Entire Bluetooth Neighborhood"). If I call BrowseForFolder it lists the folder correctly and I can pick it. But, if you see how many children it's parent contains, it says it's 0. What??? How can your parent not have any children? That's got to be a bug, right?
Also, once you find the Bluetooth device, it has a property "Mac Address" (you can right click on it in explorer and choose properties to see it). Is there any way to get this value programatically?
Here's a C# code snippet:
Shell32.ShellClass shell = new Shell32.ShellClass();
// This will bring up a Folder browser. Pick "\My Bluetooth Places\Entire Bluetooth Neighborhood"
Shell32.Folder fEntire_Bluetooth_Neighborhood =
shell.BrowseForFolder(0,"Pick Entire Bluetooth Neighboorhood",0,null);
Shell32.Folder fMy_Bluetooth_Places = fEntire_Bluetooth_Neighborhood.ParentFolder;
// Now fMy_Bluetooth_Places points to My Bluetooth Places
// and fEntire_Bluetooth_Neighborhood points to My Bluetooth Places\Entire Bluetooth Neighborhood
Shell32.FolderItems childItems = fMy_Bluetooth_Places.Items(); // take the child folder, see how many items the parent contains
int Count = childItems.Count; // Count is 0. How's that possible? My parent has no children?