I am making some customizations to a Windows Embedded build I have that needs to be deployed to multiple countries, so the customizations must be done via code after Windows is already installed.

There are some default icons on the desktop that we delete for one particular build, and that leaves some icons kind of floating in the middle of the desktop. All I really need to do is sort them once by name and it resolves it. How can I achieve this through C# code? I am running Windows 7.

The exact action I am looking to perform is Right Click on Desktop > Sort By > Name. But I dont want to do this with Sendkeys or anything like that is it's too dangerous in this type of deployment.

asked 12/09/2011 06:48

Pretzel_Jesus's gravatar image

Pretzel_Jesus ♦♦

2 Answers:
I am having trouble with touching my desktop icons in Windows 7, but this technique might work for Windows Embedded:

The documentation states that the ArrangeIconicWindows can arrange icons on the desktop.  and "To retrieve the window handle to the desktop window, use the GetDesktopWindow function."

see e.g.

no C# code, but that should just be 2 lines...

(The C++ program I used on Windows XP stopped working when I switched to 7)


algorith's gravatar image


Your answer
[hide preview]

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments



Asked: 12/09/2011 06:48

Seen: 298 times

Last updated: 12/16/2011 02:33