Desktop Icon Positioning Info

  • Thread starter Frederick R. Hutchings
  • Start date
F

Frederick R. Hutchings

Where, specifically, does Windows keep the information that it uses to
decide in what order to put the desktop icons. I can move them around at
will and they usually remember where I put them.

I can also reposition them in Windows toolbars. Does it keep that
information in a similar place?

Is it a key in the registry?

Fred
 
A

Andrew McLaren

Frederick said:
Where, specifically, does Windows keep the information that it uses to
decide in what order to put the desktop icons. I can move them around at

Desktop icon locations are stored in the registry:

HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Bags\1\Desktop

The information is stored as data type REG_BINARY; there is no reliable
way for a user to directly edit this data. You could try to reverse
engineer the binary format, but ... that way lies madness.
I can also reposition them in Windows toolbars. Does it keep that
information in a similar place?

Toolbar information is kept under the registry location for each type of
toolbar. So, Explorer toolbar settings are under:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer

IE Toolbar settings are under:

HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Toolbar

and so on.

It's great fun to go spelunking for Windows internals, but if you plan
to manipulate this data directly, you'd want to find an official API
such as SHGetStockIconInfo() and its partners ... and a programming
language, with which to call that API. These are documented in MSDN:

http://msdn.microsoft.com/en-us/library/bb773177(VS.85).aspx

Hope it helps,

Andrew
 
F

Frederick R. Hutchings

Thanks for all the info. I have Win XP SP3. Was the programming info only
for Vista?

Actually, what brought this up, is that when I installed IE8, I started
getting a white screen for several seconds (it varied) when I logged on.
Also, changes to my desktop seemed to be ignored. It was an irritation. I
got on the phone with a MS IE8 rep and we narrowed it down to whether or not
Right-Click Desktop>Arrange Icons By>Show Desktop Icons is checked. Mine is
not checked and I get the white desktop temporarily at logon. If I check
it, everything works properly. He told me that they would fix it, but,
until then, I wanted a work-around.

I like a clean desktop, so I use the built-in Desktop toolbar, hidden, at
the left of my screen. I then uncheck Show Desktop Icons. It works great
and gives me that clean desktop that I like, but now I get that error.

Anyway, when this happened, I decided to put all my desktop icons in a
folder, use that as a toolbar, and then delete them off the desktop. I
could then check Show Desktop Icons and still have a clean screen.

Rather than re-order all the icons manually, I wondered if there was a way
to copy that information from the desktop to the new toolbar.

Please tell me exactly where that information in
HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Bags\1\Desktop
and
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer
is kept? I'm not sure which sub-key or value it is. Thanks.

Fred
 
A

Andrew McLaren

Hi Fred

So if "Show Desktop Icons" is checked (the default), everything works
fine; but if "Show Desktop Icons" is unchecked, you get the white screen
for several seconds - right??

Hmmm. It's an interesting problem ...

I guess the icons you're interested in are the built-in Desktop icons,
like "My Computer", "My Documents" and "My Network Places" - right? Not
just any old doc file that lands on your desktop. These 3 built-in icons
are implemented as COM Objects, hosted in the Explorer.exe process and
instantiated from the shell32.dll and mydocs.dll libraries. Like any COM
object, they all have a fairly intricate set of connections in the
registry - data in the HKCU hive pointing to other data in the
HKCR\CLSID hive and back again, and so on.

Trying to manipulate this internal data directly in teh registry is
extremely fiddly and error-prone. What you're trying to achieve is very
reasonable; but the best way, by far, to get there will be to set it up
manually - even if that's a bit tedious.

Here's a suggestion:
- first, check "Show Desktop Icons" so the icons display on the desktop;
- drag and drop the icons you want to the Quick Launch toolbar;
- the My Documents" etc icons should no appear on the Quick Launch
toolbar, as well as the Desktop;
- next, uncheck "Show Desktop Icons";
- the icons are removed from the desktop;
- they continue to appear in the Quick Launch area

By dragging and dropping the icons to Quick Launch, you're making the
Explorer shell do all the fancy footwork to create COM pointers in the
Registry, and all that stuff. The Quick Launch icons exist as "*.lnk"
shortcut files under:

C:\Documents and Settings\<username>\Application Data\Microsoft\Internet
Explorer\Quick Launch

.... such as "My Network Places.lnk" etc. These shortcut files are opaque
binary objects; instead of a link to a file in the file system, they
contain a link the the COM objects in the Shell Namespace.

You could probably do a similar operation with the Desktop toolbar, if
you like that better than the Quick Launch toolbar. I'm pretty sure all
the Desktop toolbar data is stored deep in the Registry (not in file
system).

Hope it helps,

Andrew

-- amclar at optusnet dot com dot au
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top