[RESOLVED] Listing desktop icons
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
Re: Listing desktop icons
There are two desktops: one for all users and for for the current user. The same goes for the Start menu. You probably have some shortcuts on the common desktop. If an app is installed for all users then it will place its shortcuts in the common locations, not the current user locations.
Re: Listing desktop icons
Ah. Gotcha. That makes more sense. I guess this wasn't really a VB question at all then. My mistake :p