我如何以编程方式操作Windows桌面图标位置? [英] How can I programmatically manipulate Windows desktop icon locations?

查看:246
本文介绍了我如何以编程方式操作Windows桌面图标位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

几年前,我天真地试着写一个小应用程序,以节省我的战术放在桌面上的图标,因为我病拖他们回到自己的位置,当一些事件重置。我buring了太多时间由于未能找到一种方法来查询,更保存和重置,我的图标的桌面位置后,就放弃了。

Several years back, I innocently tried to write a little app to save my tactically placed desktop icons because I was sick of dragging them back to their locations when some event reset them. I gave up after buring WAY too much time having failed to find a way to query, much less save and reset, my icons' desktop position.

任何人都知道的Windows仍然存在此信息,如果有一个API来设置他们?

Anyone know where Windows persists this info and if there's an API to set them?

谢谢,
理查德

Thanks, Richard

推荐答案

如果我没有记错的桌面只是一个ListView,你就会有送的 LVM_SETITEMPOSITION 消息到桌面的句柄。

If I'm not mistaken the desktop is just a ListView, and you'll have to send the LVM_SETITEMPOSITION message to the handle of the desktop.

我GOOGLE了一下,其中c#code和找不到一个例子,但我却发现了下面的文章。 托里:...获取/设置桌面图标的位置?这是德尔福code,但我觉得很可读,并与一些P /调用你就可以把它翻译成C#。

I googled a bit for some c# code and couldn't find a example, but I did found the following article. Torry: ...get/set the positions of desktop icons?. It's delphi code, but I find it very readable and with some P/Invokes you'll be able to translate it to c#.

这篇关于我如何以编程方式操作Windows桌面图标位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆