WinApi-如何获取SHELLDLL_DefView [英] WinApi - How to obtain SHELLDLL_DefView
问题描述
我正在尝试获取SHELLDLL_DefView的句柄.
I am trying to obtain handle to SHELLDLL_DefView.
所以,我有这段代码.
HWND hProgman = FindWindow(L"Progman", NULL);
HWND hWnd = FindWindowEx(hProgman, 0, L"SHELLDLL_DefView", NULL);
Eveyrtihing工作正常,直到我在Windows桌面环境中将其更改为幻灯片放映.然后,当我使用Windows的spy ++层次结构进行搜索时,SHELLDLL_DefView会具有另一个父级.现在是#32769(Desktop)-> WorkerW-> SHELLDLL_DefView.所以我找不到.问题是,当我尝试
Eveyrtihing works OK, until I change in Windows desktop brackground to slideshow. Then when I search with spy++ hierarchy of the windows, than SHELLDLL_DefView has another parent. Now it is #32769 (Desktop) -> WorkerW -> SHELLDLL_DefView. So I can't find it. Problem is that when I try
HWND desktop = GetDesktopWindow();
HWND hWnd = FindWindowEx(desktop , 0, L"WorkerW", NULL);
HWND hWnd = FindWindowEx(hWnd, 0, L"SHELLDLL_DefView", NULL);
找不到SHELLDLL_DefView.是的.
Than SHELLDLL_DefView is not found. WorkerW yes.
有人可以帮忙吗?
推荐答案
我找到了答案.需要遍历所有WorkerW.
I found the answer. Need to iterate through all WorkerW.
HWND destop = GetDesktopWindow();
HWND hWorkerW = NULL;
HWND hShellViewWin = NULL;
do
{
hWorkerW = FindWindowEx(destop, hWorkerW, L"WorkerW", NULL);
hShellViewWin = FindWindowEx(hWorkerW, 0, L"SHELLDLL_DefView", 0);
} while (hShellViewWin == NULL && hWorkerW != NULL);
这篇关于WinApi-如何获取SHELLDLL_DefView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!