I am trying to save the relative positions of desktop icons.
I am using the code found here which works great on the same resolution.
I want to change the resolution and keep the icons in close to the same position as they were in the previous resolution.
I thought that would be as easy as..
in resolution 1280x720
x1=940
y1=398
then in resolution 800x600
x2=940(800/1280)
y2=398(600/720)
But this doesn't seem to be the case.
How does windows get the coordinates below when resolution is changed? What is the math here?
<Icons>
<Icon x="44" y="2">Recycle Bin</Icon>
<Icon x="44" y="101">myexe</Icon>
<Icon x="44" y="893">New Text Document.txt</Icon>
<Icon x="940" y="398">New Text Document (2).txt</Icon>
<Icon x="940" y="497">New Text Document (3).txt</Icon>
<Icon x="1836" y="2">myexe.exe</Icon>
<Icon x="1836" y="893">desktop</Icon>
<Icon x="44" y="200">fa.xml</Icon>
</Icons>
<Resolution x="1280" y="720" />
<Icon x="32" y="2">Recycle Bin</Icon>
<Icon x="32" y="69">myexe</Icon>
<Icon x="32" y="471">New Text Document.txt</Icon>
<Icon x="352" y="203">New Text Document (2).txt</Icon>
<Icon x="352" y="270">New Text Document (3).txt</Icon>
<Icon x="752" y="2">myexe.exe</Icon>
<Icon x="752" y="471">desktop</Icon>
<Icon x="32" y="136">fa.xml</Icon>
</Icons>
<Resolution x="800" y="600" />