>Hi there.
>
>Does anyone know where the actual screen co-ords are kept for desktop icons in Windows (and how to set them)?
>
>I have no idea and after doing a fair bit of searching, I've come up empty. It's an odd request but a client wants my program (which runs in the logon) to ensure that a couple of desktop icons are in a certain place on the screen.
>
>Any help on this would be greatly appreciated.
>
>TIA, Scott
Hi Scott,
I haven't try this on NT based system, only on ME. But I don't think they are (much) different.
There are two options to get the desktop icon position. The first option (the easy way) is to get it from registry. It is stored as REG_BINARY in:
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Desktop\ViewView2
So, you can just read its value, then parse each icon. The icon is structured like this:
1. left (dword)
2. top (dword)
3. icon long name (chars)
4. icon short name (chars)
HTH
Herman