#### Archived

This topic is now archived and is closed to further replies.

# Moving Icons

This topic is 5312 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

A friend asked me if I could make a quick program, and it should be simple enough that I might as well. That is, it should be simple if I can find a way to have a program rearrange icons on the desktop. Is this even possible, or is this functionality reserved for Windows itself? I looked around a bit with IActiveDesktop, which I have used for my own wallpaper changing program, but it seems to be only concerned with wallpaper and "Desktop Items." However, although I cannot seem to find a good definition of "desktop items" it seems not to include normal icons for files, folders, and things of that nature on the desktop. In short, is it possible for a program to rearrange these? If so, how? Thanks in advance! -Arek the Absolute

##### Share on other sites
Well if I knew what you meant by arrange ..

Well anyway, where is some code that will allow you to use ListView messages to arrange the icons on the desktop.

HWND hwnd = FindWindow("ProgMan", 0);hwnd = GetWindow(hwnd, GW_CHILD); // skip first childhwnd = GetWindow(hwnd, GW_CHILD);char buffer[40];GetClassName(hwnd, buffer, 39); if((strcmp(buffer, "SysListView32") == 0))	MessageBox(NULL, "Found Listview", NULL, MB_OK);SendMessage(hwnd, LVM_ARRANGE, LVA_ALIGNLEFT, 0); //align icons

Edit: fixed formatting

[edited by - Maega on January 6, 2004 1:44:19 AM]

1. 1
2. 2
3. 3
Rutin
19
4. 4
5. 5

• 10
• 14
• 30
• 13
• 11
• ### Forum Statistics

• Total Topics
631785
• Total Posts
3002346
×