最后说一句,LockWindowUpdate()的返回值MSDN里是这样说的 -------------------------------------------------------------------------------- If the function succeeds, the return value is nonzero.If the function fails, the return value is zero, indicating that an error occurred or another window was already locked. ---------------------------------------------------------------------------------- 如果你返回值为true,那可以肯定GetDesktopWindow()并没有得到你所谓的“桌面”的句柄, 要想获得桌面窗口,比较保险的方法是用 CWnd* pDesktop = CWnd::FindWindow("Progman","Program Manager")来得到,不信的话,你可以用::ShowWindow(pDesktop->GetSafeHwnd(),SW_HIDE)看看桌面图标是否隐藏了
建议用spy++看看
还有你的spy++是什么版本,为什么我的就可以看桌面?
你有比较过spy++得到的桌面的handle和用GetDesktopWindow()得到handle的值吗?
无语
--------------------------------------------------------------------------------
If the function succeeds, the return value is nonzero.If the function fails, the return value is zero, indicating that an error occurred or another window was already locked. ----------------------------------------------------------------------------------
如果你返回值为true,那可以肯定GetDesktopWindow()并没有得到你所谓的“桌面”的句柄,
要想获得桌面窗口,比较保险的方法是用
CWnd* pDesktop = CWnd::FindWindow("Progman","Program Manager")来得到,不信的话,你可以用::ShowWindow(pDesktop->GetSafeHwnd(),SW_HIDE)看看桌面图标是否隐藏了