Sign in to follow this  
Followers 0
Saddle

Icon Detection

5 posts in this topic

Goodday all,

I am new to the discussion group and would like to find out how to detect the presence and location of an icon on the desktop. I have hunted through the forums without luck and found no reference to icons in the documentation. I would like to run (select) and modify program properties of certain icons on the desktop automatically using autoit. Icons location seems to vary on different machines desktops. Say for instance, I would like to go into the properties of the "My Computer" icon, how would you find it?

Thanks

Saddle.

Share this post


Link to post
Share on other sites



I would like to run (select) and modify program properties of certain icons on the desktop automatically using autoit. Icons location seems to vary on different machines desktops....

There is usually a better way.

If you want to simulate right-click, properties on the My Computer icon, there are at least two ways:

Send("#{Pause}")

Run("control.exe sysdm.cpl")

How do I know these? See http://www.virtualplastic.net/html/misc_cut.html#5 for similar info.

(If you were instead wanting to modify the properties of a desktop shortcut, then you'd need FileFindFirstFile, FileGetShortcut, and FileCreateShortcut which might only be in the latest beta version of AutoIt.)

Good luck


Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

Thankyou for the reply.

I thought there would be a way for specific icon (types). I am trying to make an installer look for a particular setup on a machine. I know there are icon links that do not appear in set DESKTOP directories because they are "system" shortcuts. I'd like to put a desktop back to a particular look which includes certain icons in particular spots. To do this I'd have to detect them, pick them up and move them back. This doesn't seem possible from the link file themselves (is there something I'm not getting?). If I need to mod a file or registry to do this, it seemed to me to be easier to simulate dragging them there with AutoIt.

Regards,

Saddle

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Easiest way that I can think of is to use IconSaver.

If you run SaveIcons.exe, it generates a list of desktop icons and positions under the following registry key:

"HKEY_CURRENT_USER\Software\Mario Knok\IconSaver\" & @DesktopWidth & "," & @DesktopHeight

Get the settings from a good configuration and RegWrite them with AutoIt. Then Use AutoIt to fileinstall RestoreIcons.exe to a temp folder where you can run it.

Good luck

Edited by CyberSlug

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

Thankyou CyberSlug for your replies especially about Iconsaver.

I have found that it in combination with obtaining link info from the icon allows me to move and or run them. Something like:

$details = FileGetShortcut("C:\Documents and Settings\All Users\Start Menu\Programs\Accessories\System Tools\Scheduled Tasks.lnk")

run($details[0] & " "& $details[2])

Runs scheduled tasks on any machine.

Thanks again.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0