Moving Icons

Started by
0 comments, last by Arek the Absolute 20 years, 3 months ago
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
-Arek the Absolute"The full quartet is pirates, ninjas, zombies, and robots. Create a game which involves all four, and you risk being blinded by the sheer level of coolness involved." - Superpig
Advertisement
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]

This topic is closed to new replies.

Advertisement