0

I'm trying to access the names and positions of desktop icons under win10 with no luck. I posted a similar question and solution (SO#58126669) when I was using Win7. Now I find the solution (which worked perfectly under Win7) doesn't work anymore under Win10.

Here's What I Know

Under Win7, the desktop icons are stored in a SysListView32 child of the desktop. Info about each can be obtained using LVM_* messages and associated structures.

Here's What I Don't Know

Under Win10, the view hierachy appears to have changed. The SysList view no longer contains the items, but rather it has a single child of class SysHeader32. The LVM messages did not work on it. I tried using comparable HDM_* messages and structures with no luck there either.

Does anybody know how to access the desktop icons under win10?

Ken White
  • 123,280
  • 14
  • 225
  • 444
DontPanic
  • 2,164
  • 5
  • 29
  • 56
  • The documented and supported interface is IFolderView, discussed here: [How do I find the screen location of all desktop shortcuts?](https://stackoverflow.com/questions/33791827/how-do-i-find-the-screen-location-of-all-desktop-shortcuts) – Raymond Chen Jun 05 '20 at 17:17
  • I've rolled back your edit. It is not acceptable to add SOLVED to the title or add the solution to the question. If you found a solution and want to share it, do so by writing an answer in the space provided below for that purpose. If not, you're welcome to either wait for someone else to write an answer, or to delete the question. – Ken White Jul 18 '20 at 20:41

1 Answers1

0

Windows 10 uses a different approach to the desktop vs. Windows 7 as commented on by @Raymond Chen. You must use COM objects like IShellWindows, IFolderView, etc. Rather than duplicate the code here, please see the answer SO #58126669 (Window 10 Addendum).

DontPanic
  • 2,164
  • 5
  • 29
  • 56