在 Vista 上将应用程序粘贴到桌面
我有一个应用程序想要粘贴到桌面上。坚持桌面意味着每次有人单击 windows+D 或显示桌面图标时,桌面上都会出现该应用程序。
用户可以在桌面上找到该应用程序并随时更改位置,但它始终保留在桌面上。
我们设法在 XP 上通过使用 winAPI 方法 SetParent (this .Handle, FindWindow ( "Progman " , null )); 将应用程序的父级设置为桌面来做到这一点。
在 Vista 上,我们设法将其粘贴到桌面上,每当桌面获得焦点时,它就会在我们的窗口周围绘制灰色背景。当我的窗口移动时,这个背景不会消失,在桌面上留下丑陋的方块。当我单击 Windows+D 时,它们全部消失。 请注意,这种情况在 XP 上根本不会发生。
该客户端基于.NET 3.0和WPF。
知道为什么会发生以及如何解决它吗?
I have an application that I want to stick to the desktop. Stick to the desktop means that every time that someone click windows+D or the show desktop icon the desktop will appear with the application on it.
The user can locate the application on the desktop and change the location at any time but it always remains on the desktop.
We manage to do it on XP by setting the application’s parent to be the desktop using the winAPI methods SetParent (this .Handle, FindWindow ( "Progman " , null ));.
On Vista we manage to stick it to the desktop, whenever the desktop gets focus, it draws a gray background around we window. this background doesn't disappear when my window is moved, leaving ugly squares on the desktop. when I click Windows+D they all vanish.
Note that this doesn't happen on XP at all.
The client is based on .NET 3.0 and WPF .
Any idea why it happens and how to solve it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用以下代码并将窗口句柄传递给函数,同时加载表单希望这完全解决您的问题
use the following code and pass the window handle to the function while form load hope fully this resolves your problem