[x64 & x32 fix] DeskIcons - Get/Set Desktop Icon Positions

Post your working scripts, libraries and tools
User avatar
joedf
Posts: 6292
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

[x64 & x32 fix] DeskIcons - Get/Set Desktop Icon Positions

09 May 2014, 21:18

The function was created by Rapte_Of_Suzaku.
Function to save desktop icon positions and later restore them. Designed with DynamicDesktop in mind, but will work fine on its own.

Originally posted here: http://www.autohotkey.com/board/topic/6 ... positions/
The script has been updated to work with both x64 and x86.

Code: [Select all] [Expand] [Download] (DeskIcons.ahk)GeSHi © Codebox Plus



Cheers
User avatar
joedf
Posts: 6292
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: [x64 & x32 fix] DeskIcons - Get/Set Desktop Icon Positio

10 May 2014, 12:12

Lool!
drabne
Posts: 22
Joined: 17 Feb 2014, 02:26

Re: [x64 & x32 fix] DeskIcons - Get/Set Desktop Icon Positio

04 Sep 2014, 05:05

This function doesn't work for me in Win 8.1 x64
User avatar
joedf
Posts: 6292
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: [x64 & x32 fix] DeskIcons - Get/Set Desktop Icon Positio

04 Sep 2014, 20:09

Hmm, I'll try to fix it when I get back from my trip.
Regards, ;)
User avatar
xZomBie
Posts: 256
Joined: 02 Oct 2013, 02:57

Re: [x64 & x32 fix] DeskIcons - Get/Set Desktop Icon Positio

07 Sep 2014, 11:13

DeskIcons doesn't work for me either...
User avatar
joedf
Posts: 6292
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: [x64 & x32 fix] DeskIcons - Get/Set Desktop Icon Positio

07 Sep 2014, 16:37

And what is your system, xZombie? ;)
Will be fixed when I get back. :)
User avatar
xZomBie
Posts: 256
Joined: 02 Oct 2013, 02:57

Re: [x64 & x32 fix] DeskIcons - Get/Set Desktop Icon Positio

08 Sep 2014, 06:57

I was about to post it in there but then I realized it was already in my signature.
Anyways, I on Win7 64bit. The example script doesn't work.
BTW, there is a script made by the original creator of DeskIcons. DesktopHomes
User avatar
joedf
Posts: 6292
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: [x64 & x32 fix] DeskIcons - Get/Set Desktop Icon Positio

16 Sep 2014, 11:50

I just tested it. It works fine...
Try this ;)

Code: [Select all] [Download] GeSHi © Codebox Plus

coords := DeskIcons()
MsgBox now move the icons around yourself, PRESS OK AFTER MOVING THE ICONS
MsgBox move the icons, then press OK, ok?
; load positions
DeskIcons(coords)
User avatar
joedf
Posts: 6292
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: [x64 & x32 fix] DeskIcons - Get/Set Desktop Icon Positio

17 Sep 2014, 01:19

No problem ;)
User avatar
xZomBie
Posts: 256
Joined: 02 Oct 2013, 02:57

Re: [x64 & x32 fix] DeskIcons - Get/Set Desktop Icon Positio

17 Sep 2014, 11:01

:wtf: It works now... :think: Don't know why it didn't the last time... :trollface:
Edit: Some Desktop.ini(Hidden files) are detected by DeskIcon and their icon locations are recorded. Is there a way to ignore those files?
User avatar
joedf
Posts: 6292
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: [x64 & x32 fix] DeskIcons - Get/Set Desktop Icon Positio

17 Sep 2014, 12:10

Try this?
IconPositions:=DeskIcons("","desktop.ini")

Code: [Select all] [Expand] [Download] (script.ahk)GeSHi © Codebox Plus

User avatar
Relayer
Posts: 112
Joined: 30 Sep 2013, 13:09
Location: Delaware, USA

Re: [x64 & x32 fix] DeskIcons - Get/Set Desktop Icon Positio

23 Sep 2014, 10:05

Hi,

A natural extension of this would be to record / reset positions of icons in custom toolbars. I am not referring to application toolbars, but instead just the windows 7 toolbar facility that is part of the desktop / taskbar.

Windows keeps the icons in a folder for a particular toolbar but the folder does not reflect the position of each icon relative to the others once the toolbar is displayed.

Relayer
User avatar
joedf
Posts: 6292
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: [x64 & x32 fix] DeskIcons - Get/Set Desktop Icon Positio

23 Sep 2014, 17:46

ill see what i can do. ;)
tempuser
Posts: 6
Joined: 30 Jan 2018, 17:37

Re: [x64 & x32 fix] DeskIcons - Get/Set Desktop Icon Positions

09 Mar 2018, 17:06

I can't get consistent results from running this code.
Few times it works fine, but at some launch it stops run and this function returns empty value.
Windows 10 x64.
User avatar
joedf
Posts: 6292
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: [x64 & x32 fix] DeskIcons - Get/Set Desktop Icon Positions

09 Mar 2018, 21:44

Oh that’s weird... possibly broken by updates ... hmm :think:
User avatar
joedf
Posts: 6292
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: [x64 & x32 fix] DeskIcons - Get/Set Desktop Icon Positions

09 Mar 2018, 21:48

VirtualAllocEx or VirtualFreeEx
Might be the culprit...
Guest_3102018

Re: [x64 & x32 fix] DeskIcons - Get/Set Desktop Icon Positions

10 Mar 2018, 13:35

I am having the same issue. Windows 10 x64 FCU. Currently I have this script in a larger script which has #Warn enabled. As a result, when it's not working, I receive a couple errors. Both are variables without assigned values. The latter is probably caused by the former but that would be more your department ;-) Hopefully this is helpful. If you need any other info, just ask.

iProcessID in hProcess := DllCall("OpenProcess" , "UInt", 0x438, "Int", FALSE, "ptr", iProcessID)
ret in Return, ret after DllCall("CloseHandle", "ptr", hProcess)
User avatar
joedf
Posts: 6292
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: [x64 & x32 fix] DeskIcons - Get/Set Desktop Icon Positions

10 Mar 2018, 15:11

Are you saying OpenProcess is not working correctly either?

Return to “Scripts and Functions”

Who is online

Users browsing this forum: No registered users and 6 guests