News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Desktop icons and the shell

Started by sinsi, April 09, 2007, 08:39:35 AM

Previous topic - Next topic

sinsi

I am having a few problems with the shell (I assume)...I've written a program that will change
the desktop's SysListView32 view to "Small Icon". All goes well on my box (XPHSP2), but
   - where does the icon layout (i.e. position) get stored? It seems to be "IconCache.db"
   - where does the setting for "Auto Arrange" get stored? Regedit (yes, I know) can't find any similar

The reason I ask is that I've written a program that will change the desktop to small icon view
and restore a previously saved icon layout. It's been working a treat for me until a mate asked
about "Auto Arrange". I switched it on, my icons were arranged upper-left columns, switched it off,
restored the saved positions and...every time I rebooted Windows would arrange them upper-left.
Changing resolution fixed it eventually but how? Any ideas would be appreciated...

Is this just a case of <don't mess with the shell> or can I delete "IconCache.db" as part of my program?
Googling "IconCache.db" tells me how to restore shortcuts, but no links to MS as to WTF the file is.

ETA: I remember an article on the web about multi-desktops and their handles, if anyone has some info
on that I would be most grateful - I thought it was on The Old New Thing, MSDN/SDK2003 is useless...
Light travels faster than sound, that's why some people seem bright until you hear them.

sinsi

Jeez man.  4+hours and not one reply? Maybe I should look at some heh heh HaXor (is that right?) sites...or leet sites (oops) or fuckin' HACKER sites...damn these beers
beer is the answer to all (mixed with vodka and pepsi, that is orl-rite) jeez man...jeez man, i can't emphasize it enough...jeez man...happy f'en Easter
Light travels faster than sound, that's why some people seem bright until you hear them.

hutch--

 :bg

I honestly don't know thew answer to your question but the Vodka and Pepsi sounds seriously dangerous. In my youth I managed to get very drunk on Vodka mixed with bitter lemon and I have left it alone ever since.  :dazzled:
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

sinsi

Quote from: hutch-- on April 09, 2007, 01:00:40 PM
:bg

I honestly don't know thew answer to your question but the Vodka and Pepsi sounds seriously dangerous. In my youth I managed to get very drunk on Vodka mixed with bitter lemon and I have left it alone ever since.  :dazzled:
Ah, my first experience was Fruit Box (Fruit Punch!!!) and vodka in the '80s...yum yum (I remember cleaning up the spew the next morning - hair DOES stiffen oh boy, but looked good on an 80's stud...heh heh (so I was told by a *nice babe*)

Anyway, you old fart, can you help me with my programming conundrum? Or are you full of "piss and wind" heh heh (my god I can (ATM) fullfill the wind bit...)
Light travels faster than sound, that's why some people seem bright until you hear them.


sinsi

What the hell is that baby's bottle  :bg


Can anyone help me with my program?
I will post my code if it helps, but since I have posted it before (in other threads) it may not matter...


Jeez, it is midnight here and I am PAAF and looking for answers,,,
Light travels faster than sound, that's why some people seem bright until you hear them.

Jimg

Could you restate your question again?  I'm unclear as to what it is exactly that you want to accomplish.

I assume you know how to change the autoarrange setting with code, e.g.
    IDM_TOGGLEAUTOARRANGE equ 7041h
    inv SendMessage,hParent,WM_COMMAND,IDM_TOGGLEAUTOARRANGE,0
etc.
Doing so should set it permanently.

And I assume you know how to read and set the icon locations.  Again, doing so should set it permanently.

(More complete code here - http://www.masm32.com/board/index.php?topic=2704.0)

Vortex


sinsi

Thanks Jimg, now I know how to toggle auto arrange.
Any idea where Windows keeps its list of icon positions?


Oh boy do I have a hangover this morning... :red
Forget drink-driving, I'm never drink-posting again
Light travels faster than sound, that's why some people seem bright until you hear them.

Jimg

If you look at the code for the program I pointed you to, it shows how the get them.  You have to ask the system for them (Progman/SysListView32), you can't read them directly.  It you can't understand my code (it's in the FormLoad proc and GetDesktopIconInfo proc), ask and I'll put something together.

sinsi

I know how to get/set positions and text, what I'm wondering is where Windows stores this information. Every now and then Windows
will rearrange my desktop (which is annoying), I would like to somehow stop this.
Light travels faster than sound, that's why some people seem bright until you hear them.

Jimg

That is precisely why I wrote my program. It was driving me crazy also.  After a year or research, that's the best I could find.  You can't access them directly, you can't just read and write a file, you have to ask the system for them and tell it where to put them.
I'll run an incntrl, move one, and let you know the results, but I don't hold out a lot of hope.

Jimg

Nope, no luck.  I'm pretty sure the system doesn't update wherever it keeps the info until the machine is shutdown or rebooted.  In fact I'm sure because in my tests, if the machine crashed, the new positions weren't saved.

sinsi

Thanks for trying Jim. I reckon it's got something to do with the IconCache.db file - the file's date/time seems to be the logoff time.
Light travels faster than sound, that's why some people seem bright until you hear them.

Jimg

Well, I just deleted iconcache.db and turned the power off on the computer so it couldn't write a new one.  Windows was very unhappy when I turned the computer back on, but it didn't have any problem placing the icons.  In fact, all the positions came up immediately but were at first filled with a generic icon picture, and eventually windows found and drew all the icons themselves.  So I suspect that IconCache is just a db of the actual graphics for the icons to make loading faster.