I need to obtain a list of desktop icons and add them to a ListView. I'm currently doing this:
VB.NET Code:
For Each dIcon In My.Computer.FileSystem.GetFiles(My.Computer.FileSystem.SpecialDirectories.Desktop) Dim DesktopIconImageList As System.Drawing.Icon = Icon.ExtractAssociatedIcon(dIcon) DesktopImages.Images.Add(DesktopIconImageList.ToBitmap) lvwDesktopIcons.Items.Add(dIcon, DesktopImages.Images.Count - 1) Next
It points to the direct path the icons should be located under the user profile. However, for some reason I've yet to determine, not all of the icons are in this directory.
Does anyone know of a better method to obtain the desktop icons?
Thanks


Reply With Quote
