10

To modify a window of another program, I need to find a specific SysTreeView32 in it using EnumChildWindows API call.

When I inspect the window using Spy++, there are a number of SysTreeView32's in it but all are greyed out except one, which is the one I'm looking for.

The following picture is an example of grey items:

Why are some items grey?

Why are the shown items gray and what API call does Spy++ use to know whether it should grey out an item or not?

Hossein
  • 4,097
  • 2
  • 24
  • 46

1 Answers1

17

Those are just non-visible windows - ie HWNDs that don't have the WS_VISIBLE style bit set. They are often worker windows - windows that just exist to process various messages in the background - or in some cases are UI that's yet to become visible. For example, a window that lets you hide or show a toolbar may just hide it by making it invisible rather than destroying it and recreating it later.

In your specific case, the WorkerW could be a placeholder for some other piece of UI that's not needed right now, while the msctl_statusbar32 looks like it's a hidden status bar.

BrendanMcK
  • 14,252
  • 45
  • 54
  • 8
    Also notice that window may be grayed even if it has WS_VISIBLE=true set - when one of its parents has WS_VISIBLE=false. – levanovd Aug 11 '11 at 08:12