Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Positions of icons in SysListView32 eg Desktop?

156 views
Skip to first unread message

Robert Pitt

unread,
Aug 28, 1997, 3:00:00 AM8/28/97
to

Is there any hack to get the position of icons in a ListView control (when
in Icon mode)?

Specifically I'm looking for a reliable way to retreive/set positions of
icons on the Win95 desktop.
(I bet this questions been asked a few times before)

I know that the positions are *likely* to have been saved in the registry
under
HKEY_USERS\.Default\Software\Microsoft\Windows\CurrentVersion\Explorer\Strea
ms\
but these are only read/written on shutdown/bootup.

I could change the values in the registry but how would I persuade explorer
to read them back in again?
(Also how would I know which stream number corresponds the the desktop
anyway!!!)

Please tell me someone has figured all this out & point me in the right
direction.

Thank in advance.

Rob...@CyberDude.com


PS. Out of curiousity I wonder what happens if you use SetWindowLong to
mutate the style of the Desktop from being Icon view to Small Icon view.
Will try this in a bit.


Tony Hoyle

unread,
Aug 28, 1997, 3:00:00 AM8/28/97
to

On Thu, 28 Aug 1997 08:37:39 GMT, "Robert Pitt"
<Rob...@CyberDude.com> wrote:

>Is there any hack to get the position of icons in a ListView control (when
>in Icon mode)?
>
>Specifically I'm looking for a reliable way to retreive/set positions of
>icons on the Win95 desktop.
>(I bet this questions been asked a few times before)
>

??? The desktop isn't a list view... whatever gave you that idea?

The icons on the desktop are just chilld windows of the desktop window
- just enumerate them and you'll get the info you need.

Tony

----------------------------------------------------
"640K should be enough for anybody" -- Bill Gates

t...@netfusion.co.uk
----------------------------------------------------

Robert Pitt

unread,
Aug 28, 1997, 3:00:00 AM8/28/97
to

child windows! - I think not.

Katy Mulvey

unread,
Aug 28, 1997, 3:00:00 AM8/28/97
to

In <<34056994.81732825@news>>, Tony Hoyle <t...@netfusion.co.uk> wrote:
>??? The desktop isn't a list view... whatever gave you that idea?
>
>The icons on the desktop are just chilld windows of the desktop window
>- just enumerate them and you'll get the info you need.

Sure it is. Use a utility like Spy++ and point to the desktop, and
you'll see that the window class is SysListView32.

I have no idea how to get its handle, though.

Katy

Tony Hoyle

unread,
Aug 28, 1997, 3:00:00 AM8/28/97
to

Nah... The desktop's class is '#32769 (Desktop)' on my system.
Explorer windows are generally SysListView32, but that's because they
usually are list views.

What you get back from FindWindow aint the desktop - it has a parent
(SHELLDLL_DefView) and is a child of explorer (aka. Progman).

Chris Marriott

unread,
Aug 28, 1997, 3:00:00 AM8/28/97
to

In article <34056994.81732825@news>, Tony Hoyle <t...@netfusion.co.uk>
writes

>??? The desktop isn't a list view... whatever gave you that idea?

The fact that it's true, perhaps?

The desktop is indeed a listview in "large icon" display mode. You can
easily verify this for yourself using the "Spy++" tool supplied with
VC++, or an equivalent.

Chris

----------------------------------------------------------------
Chris Marriott, Microsoft Certified Solution Developer.
SkyMap Software, U.K. e-mail: ch...@skymap.com
Visit our web site at http://www.skymap.com

Joachim Feise

unread,
Aug 28, 1997, 3:00:00 AM8/28/97
to

Tony Hoyle wrote:
>
> On 28 Aug 1997 14:59:32 GMT, k...@ormec.com (Katy Mulvey) wrote:
>
> >In <<34056994.81732825@news>>, Tony Hoyle <t...@netfusion.co.uk> wrote:
> >>??? The desktop isn't a list view... whatever gave you that idea?
> >>
> >>The icons on the desktop are just chilld windows of the desktop window
> >>- just enumerate them and you'll get the info you need.
> >
> >Sure it is. Use a utility like Spy++ and point to the desktop, and
> >you'll see that the window class is SysListView32.
> >
> >I have no idea how to get its handle, though.
> >
> > Katy
> Nah... The desktop's class is '#32769 (Desktop)' on my system.
> Explorer windows are generally SysListView32, but that's because they
> usually are list views.
>
> What you get back from FindWindow aint the desktop - it has a parent
> (SHELLDLL_DefView) and is a child of explorer (aka. Progman).

Apparently, you don't know that what you see as desktop in Win95 and NT
4
actually IS an explorer window!
So, yes, SysListView32 is where the desktop icons are.
And, you don't get the task manager when you do a right click on the
"Desktop", like you did in Win3.x and NT3.x.
Another hint: kill Explorer in the task manager, and you see all icons
(and the taskbar) vanish. In NT4, everything is reloaded, so there is no
risk.
In fact, I just wrote a program to subclass SysListView32 to change the
background bitmap, and it works fine. Since I put my DLL in the Explorer
address space, it crashed several times during development. No harm
done,
since NT4 reloads it.

Joe

Steve Dirickson [SDK MVP]

unread,
Aug 29, 1997, 3:00:00 AM8/29/97
to

t...@netfusion.co.uk (Tony Hoyle) wrote:

>On Thu, 28 Aug 1997 08:37:39 GMT, "Robert Pitt"
><Rob...@CyberDude.com> wrote:
>
>>Is there any hack to get the position of icons in a ListView control (when
>>in Icon mode)?
>>
>>Specifically I'm looking for a reliable way to retreive/set positions of
>>icons on the Win95 desktop.
>>(I bet this questions been asked a few times before)
>>

>??? The desktop isn't a list view... whatever gave you that idea?
>
>The icons on the desktop are just chilld windows of the desktop window
>- just enumerate them and you'll get the info you need.

I'm afraid you're working with old information, like from 16-bit
Windows. Under Windows 95 and NT 4+, the desktop is in fact a standard
list-view window in large-icon mode.

Thought for the day: If you aren't pretty sure that you know what
you're talking about, it might be better to remain in "listen mode".


Steve Dirickson WestWin Consulting
(360) 598-6111 sdir...@kpt.nuwc.navy.mil

Bernd Luevelsmeyer

unread,
Aug 29, 1997, 3:00:00 AM8/29/97
to

Chris Marriott wrote:
>
> In article <34056994.81732825@news>, Tony Hoyle <t...@netfusion.co.uk>
> writes

> >??? The desktop isn't a list view... whatever gave you that idea?
>
> The fact that it's true, perhaps?
>
> The desktop is indeed a listview in "large icon" display mode. You can
> easily verify this for yourself using the "Spy++" tool supplied with
> VC++, or an equivalent.
>
> Chris
>
> ----------------------------------------------------------------
> Chris Marriott, Microsoft Certified Solution Developer.
> SkyMap Software, U.K. e-mail: ch...@skymap.com
> Visit our web site at http://www.skymap.com

The desktop isn't a listview, its classname is "#32769".

Perhaps the "explorer" will, if running as a shell, put
some large listview over the desktop, but i'm not sure about
that.

Greetings,
Bernd

Dirk Fieldhouse

unread,
Aug 29, 1997, 3:00:00 AM8/29/97
to

In article <3405b5da.12108771@news>, Tony Hoyle (t...@netfusion.co.uk) says...

>
>On 28 Aug 1997 14:59:32 GMT, k...@ormec.com (Katy Mulvey) wrote:
>
>>In <<34056994.81732825@news>>, Tony Hoyle <t...@netfusion.co.uk> wrote:
>>>??? The desktop isn't a list view... whatever gave you that idea?
>>>
>>>The icons on the desktop are just chilld windows of the desktop window
>>>- just enumerate them and you'll get the info you need.
>>
>>Sure it is. Use a utility like Spy++ and point to the desktop, and
>>you'll see that the window class is SysListView32.
>>
>>I have no idea how to get its handle, though.
>>
>> Katy
>Nah... The desktop's class is '#32769 (Desktop)' on my system.
>Explorer windows are generally SysListView32, but that's because they
>usually are list views.
>
>What you get back from FindWindow aint the desktop - it has a parent
>(SHELLDLL_DefView) and is a child of explorer (aka. Progman).

The shell desktop is a ListView. Here I am looking at Windows 95a. The relevant
part of the window tree is

"Desktop" (#32769)
|
+-- "Program Manager" (Progman)
|
+-- "" (SHELLDLL_DefView)
|
+-- "" (SysListView32)
|
+-- "" (SysHeader32)

Dektop is the global parent and has no interesting behaviour AFAIK, except that
it's where any desktop settings (pattern, wallpaper) apply.

Program Manager is there for compatibility with applications that expect a 3.x
shell, but is hidden by its children, which have the same structure as a
ListView like My Computer.

The SHELLDLL_DefView window seems to be where the icons are drawn - when it's
hidden, the desktop icons disappear.

The SysListView32 presumably is what fields the OLE stuff, drag&drop, etc. Its
window properties include things like:

00000004 = OleEndPointID
000003D4 = EndPoint_Notify_UL
FFFC0BB3 = EndPoint_Punk_TID
005404F0 = OleDropTargetInterface

Compared with a My Computer-style window, this has the style bits LVS_NOSCROLL
| LVS_ALIGNLEFT, which explains the different behaviour of the shell desktop.

Also, when you have a desktop pattern or wallpaper, hiding this window deletes
the icons - hmmmmm.


--
Dirk Fieldhouse Logica UK Limited
field...@logica.com 75 Hampstead Road
c=gb;a=attmail;p=logica; London NW1 2PL
o=lg;ou1=lgwct;s=fieldhouse UK
+44 (171) 637 9111


Bernd Luevelsmeyer

unread,
Aug 31, 1997, 3:00:00 AM8/31/97
to

Chris Marriott wrote:
>
> In article <3406B6...@iplan.heitec.net>, Bernd Luevelsmeyer
> <bernd.lue...@iplan.heitec.net> writes

> >The desktop isn't a listview, its classname is "#32769".
> >
> >Perhaps the "explorer" will, if running as a shell, put
> >some large listview over the desktop, but i'm not sure about
> >that.
>
> Sorry, Bernd, but you're wrong. The desktop window itself does indeed
> have a classname of "#32769", but it has a child which is a listview.
> That child is what you *see* as the desktop - it is a listview in "large
> icon" display mode.
>
> Do this:
>
> 1. Run "Spy++".
>
> 2. From the "Spy" menu, select "Find Window".
>
> 3. Drag the "Finder Tool" over any blank area of the desktop.
>
> The window will show:
>
> Class: SysListView32
>
> which is the class name of the listview control. That's on my NT4
> machine, but it's exactly the same on Windows 95.
>
> Regards,

>
> Chris
>
> ----------------------------------------------------------------
> Chris Marriott, Microsoft Certified Solution Developer.
> SkyMap Software, U.K. e-mail: ch...@skymap.com
> Visit our web site at http://www.skymap.com


Hm. I don't have that "Spy++", but if i close everything except
one console and then enumerate all windows, i find:

- the background/desktop, class "#32769"
- one window belonging to the "system"-process, hidden, class "#32768",
without childs
- one window of NetDDE Agent, hidden, class "NDDEAgnt",
without childs
- one hidden window, class "tooltips_class32", without childs
- one window to display the window-list, class "SysTreeView32", no
childs
- one console-window, class "ConsoleWindowClass", no childs

There is no SysListView32 anywhere. I insist must be a feature of
"explorer", which is not my shell.

Greetings,
Bernd

Joachim Feise

unread,
Sep 1, 1997, 3:00:00 AM9/1/97
to

To reiterate:
the background/desktop has a classname of "#32769". But if you run
the explorer as shell, you work with the explorer instead of
the background.
In fact, you can not even put icons on the background.
This was the original question, how to get to these icons. And for
that, you have to have the explorer as shell, and you have to
work with the Syslistview32 window.
Actually, in NT4, you don't even get to the "#32769" window.
Even Spy++ refuses to show window messages to that window. In NT4,
you have to work with Syslistview32.

BTW, Spy++ comes with Visual C++.

Greetings
Joe

0 new messages