问题
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 the shown items gray and what API call does Spy++ use to know whether it should grey out an item or not?
回答1:
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.
来源:https://stackoverflow.com/questions/6936283/why-are-some-items-greyed-out-in-spys-windows-view