把窗体钉在桌面是如何实现的

2025-05-14 10:42:01
推荐回答(1个)
回答(1):

把你的窗口的父窗口句柄设置为名称为Progman的窗口 的句柄就可以了。
HWND hDesktop = ::FindWindow("Progman", NULL);
//hDesktop = ::GetWindow(hDesktop, GW_CHILD);
CWnd* pWndDesktop = CWnd::FromHandle(hDesktop);
this->SetParent(pWndDesktop);