Hi
@lexikos
The window which actually contains the desktop icons on Windows 10 is WinExist("ahk_class WorkerW", "FolderView")
That's usually the case for people who opt for slideshow background.
The listview that hosts Desktop icons is a child of
ahk_class SHELLDLL_DefView
The owner of
SHELLDLL_DefView can dynamically change from
ahk_class Progman to
ahk_class WorkerW
I never use slideshow background. So when windows boot,
ahk_class Progman has been the parent of
ahk_class SHELLDLL_DefView
for me in Window 7, 8.1 and 10.
The ownership/parentship will be transferred to
ahk_class WorkerW if I use WIN+TAB in Win 10. which I usually don't. (WIN+TAB also does this in Win 7, I think).
SetParent() has side effects, for example the window changes theme to Win 7 and also become slightly transparent.
In my
OSDTIP_Dektop(), I don't use SetParent().
I just set
ahk_class SHELLDLL_DefView as the owner of my Progress UI, so any change to
ahk_class SHELLDLL_DefView's owner/parent wouldn't affect my UI.
I think the rule for
Show desktop is something like this.
When
Win+D is pressed, all windows except the parent of
ahk_class SHELLDLL_DefView will get minimized.
and this is what happening to OP:
Progman wasn't the parent of
ahk_class SHELLDLL_DefView and was set as the parent of a window.
WIn+D was pressed to see the desktop and both Progman and its child Window got minimized.
Code: Select all
WinExist("ahk_class WorkerW", "FolderView")
That's beautiful. Simple, yet I didn't think of it,
It wouldn't be affected by
DetectHiddenWindows, on like my
DesktopIcons() does.
It's irrelevant whether you use uint or ptr when passing HWND values.
I didn't know. Thanks.
I guess nobody would look inside my OSDTIP() topic to find this.
I will post a separate function and tag you.