如何找到所有桌面快捷方式的屏幕位置? [英] How do I find the screen location of all desktop shortcuts?

查看:78
本文介绍了如何找到所有桌面快捷方式的屏幕位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在客户桌面上放置了许多快捷方式,它们希望将它们组合在一起以便于使用,并且远离其他程序可能会使用的其他快捷方式.如果他们更改屏幕分辨率,监视或对显示进行其他更改,则快捷方式将变得混乱".

We have a number of shortcuts that are placed on our customer desktops and like to keep them together for easy use, and away from other shortcuts that they may use for other programs. If they change the screen resolution, monitor or make other changes to the display, the shortcuts become "scrambled".

我找到了一些代码示例来查找快捷方式的其他属性,例如.目标,但我没有看到任何指示快捷方式在屏幕上实际位置的属性.

I found some code examples to find other properties of shortcuts, eg. target, but I didn't see any properties that indicate where the shortcut is physically located on the screen.

我当时正在考虑创建一个简单的程序,该程序可以读取快捷方式的位置,并在它们位于正确位置时将其保存到文件中.只需按一下按钮,便可以将它们恢复到正确的位置.

I was thinking of creating a simple program that reads the location of our shortcuts and saves this to a file when they are in the correct locations. A simple button press would allow them to be restored to their correct places.

我在Delphi中编程,我们正在各种客户计算机上使用W7-10.

I am programming in Delp we are using W7-10 on various customer machines.

推荐答案

shell API为此提供了功能.关键界面是 IFolderView ,尤其是方法 IFolderView :: GetItemPosition IFolderView :: SelectAndPositionItems .

The shell API provides functionality for this. The key interface is IFolderView, and in particular the methods IFolderView::GetItemPosition and IFolderView::SelectAndPositionItems.

在某种程度上涉及使用shell API.与往常一样,在调用这些方法之前,需要花费大量的脚手架.我指的是雷蒙德·陈(Raymond Chen)的文章,操纵台式机的位置图标,其中提供了执行此操作的示例代码.

Using the shell API is somewhat involved. As always, it takes to fair amount of scaffolding before you get to call these methods. I refer you to Raymond Chen's article, Manipulating the positions of desktop icons, which gives example code to do this.

这篇关于如何找到所有桌面快捷方式的屏幕位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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