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

Post your working scripts, libraries and tools for AHK v1.1 and older
User avatar
joedf
Posts: 8953
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

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

16 Jan 2019, 16:03

try changing

Code: Select all

; save positions
!s::coords := DeskIcons()
FileDelete, %ProgramData%\TEMP\desktopicons.txt
FileAppend, %coords%, %ProgramData%\TEMP\desktopicons.txt 
return
to

Code: Select all

; save positions
!s::
coords := DeskIcons()
FileDelete, %ProgramData%\TEMP\desktopicons.txt
FileAppend, %coords%, %ProgramData%\TEMP\desktopicons.txt 
return
Also, make sure you are running the latest version? v1.1.30+
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
vanipede
Posts: 5
Joined: 10 Jan 2019, 17:16

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

16 Jan 2019, 17:25

joedf wrote:
16 Jan 2019, 16:03
try changing

Code: Select all

; save positions
!s::coords := DeskIcons()
FileDelete, %ProgramData%\TEMP\desktopicons.txt
FileAppend, %coords%, %ProgramData%\TEMP\desktopicons.txt 
return
to

Code: Select all

; save positions
!s::
coords := DeskIcons()
FileDelete, %ProgramData%\TEMP\desktopicons.txt
FileAppend, %coords%, %ProgramData%\TEMP\desktopicons.txt 
return
Also, make sure you are running the latest version? v1.1.30+
Thank you! I was trying to use AHK2 and do pretty much what you wrote, but it wouldn't work with that bit of code. I installed 1.1.30.01 and it's working great!
User avatar
joedf
Posts: 8953
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

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

17 Jan 2019, 09:54

Glad to hear things are working! :+1:
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
User avatar
Drugwash
Posts: 850
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

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

18 Jan 2019, 05:14

vanipede wrote:
16 Jan 2019, 17:25
[…] I was trying to use AHK2 […]
Somewhere in this thread there's a version of the script made for AHK v2 by Flipeador; you may wanna try that one too if you want to use v2.

@ JoeDF: Have you ever gotten to check that feature request regarding toolbar icons? I'd be interested in that too, because sometimes I have to kill Explorer due to modem connection getting stuck on disconnecting and at that point any customization to such toolbar icons (and QuickLaunch too, on XP) gets lost.
Logic says such changes are kept in memory and are only applied upon shutdown/reboot, so we'd have to find a way to either read/store/restore memory data or manually/forcibly flush the Explorer cache.
I haven't been able to find any information on that in my previous searches and my current Internet connection (which you know of already) doesn't allow me much room for search. Any information on the issue would be greatly appreciated.
Part of my AHK work can be found here.
vanipede
Posts: 5
Joined: 10 Jan 2019, 17:16

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

18 Jan 2019, 15:25

Drugwash wrote:
18 Jan 2019, 05:14
Somewhere in this thread there's a version of the script made for AHK v2 by Flipeador; you may wanna try that one too if you want to use v2.
That's actually the code I used, but I couldn't get the FileAppend to work correctly.
User avatar
Flipeador
Posts: 1204
Joined: 15 Nov 2014, 21:31
Location: Argentina
Contact:

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

18 Jan 2019, 18:13

vanipede⠀ wrote:That's actually the code I used, but I couldn't get the FileAppend to work correctly.
Updated: https://www.autohotkey.com/boards/viewtopic.php?f=6&t=3529&p=205365#p205365.
User avatar
joedf
Posts: 8953
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

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

19 Jan 2019, 14:08

Drugwash wrote:
18 Jan 2019, 05:14
vanipede wrote:
16 Jan 2019, 17:25
[…] I was trying to use AHK2 […]
Somewhere in this thread there's a version of the script made for AHK v2 by Flipeador; you may wanna try that one too if you want to use v2.

@ JoeDF: Have you ever gotten to check that feature request regarding toolbar icons? I'd be interested in that too, because sometimes I have to kill Explorer due to modem connection getting stuck on disconnecting and at that point any customization to such toolbar icons (and QuickLaunch too, on XP) gets lost.
Logic says such changes are kept in memory and are only applied upon shutdown/reboot, so we'd have to find a way to either read/store/restore memory data or manually/forcibly flush the Explorer cache.
I haven't been able to find any information on that in my previous searches and my current Internet connection (which you know of already) doesn't allow me much room for search. Any information on the issue would be greatly appreciated.
Whoops! Sorry I must forgotten over time. I have been side tracked by too many things :b
I am not super sure how it works. I will do some searching now. :thumbup:
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
User avatar
Drugwash
Posts: 850
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

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

19 Jan 2019, 14:19

Understandable, don't worry. Hopefully you find some lead on this at some point. ;)
Part of my AHK work can be found here.
User avatar
Drugwash
Posts: 850
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

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

19 Jan 2019, 15:19

The links above say "taskbar". It's not the taskbar, it's additional bars (AHK class is 'BaseBar' in XP) that can be stuck to the sides of the screen, can be autohidden and always-on-top. These were available in Win9x and XP (possibly in 2000 too) but couldn't find them in Win7. Search engines suddenly can't find any relevant info on that (and why is that a wonder when it comes to M$…)
It's mainly a folder on the HDD containing links to applications, displayed as a narrow bar with icons. When an icon is clicked, the application is launched. Similar to the QuickLaunch (also available in Win98/ME/2000/XP only) which apparently is an IE control of sorts.

One can add/delete/move icons (that is, links) within the toolbar(s), same as in QuickLaunch. However, such changes are not being saved instantly but only on shutdown/reboot. If something breaks the Explorer or crashes the system, the new icon positions will be lost because they were not saved (to the registry?). We need a way to find where/how those icon positions are kept in memory and force-save them or at least copy/paste that information later on after (re)boot.
taskbar+toolbar.png
taskbar+toolbar.png (257.88 KiB) Viewed 5775 times
Part of my AHK work can be found here.
User avatar
joedf
Posts: 8953
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

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

20 Jan 2019, 21:16

Your system "style" seems so non-standard I'm not even sure if that is Windows XP or something else? I dont even know how I can test this... I would have to run a virtual machine...
I think those are folder based no? I would simply name them 1.lnk, 2.lnk, 3.lnk etc.
then go into the shortcut option and set the description to the application name.
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
User avatar
Drugwash
Posts: 850
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

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

21 Jan 2019, 06:54

Haha, it's just a custom theme/style, nothing more, using a patched uxtheme.dll. :) Yes it's XP, I couldn't use anything higher on a daily basis and it even took me a while to get accustomed to its anal-retentiveness in certain regards after my 98SE machine got put on hold for repairs.
Anyway, those toolbars are nothing out of the ordinary for these "old" Windows versions - just right-click the taskbar and the menu offers some standard toolbars and a New toolbar entry where one can select a folder containing links (or an Internet address).
Apparently the BaseBar class is an IE Toolbar (see here, because here they completely leave out the system-only window classes).

There's been a discussion on the old boards here regarding creation of a BaseBar window but there's been no positive outcome so far. I may try my hand at creating such window too, maybe it could help with testing.
Simply naming the links in an ascending order wouldn't cut it - the bar has drag'n'drop capability within it and to/from Desktop or file managers, automatically creates links when something is dropped. Much like the QuickLaunch, which is also a target of this forced icon position flush we need.
Part of my AHK work can be found here.
User avatar
joedf
Posts: 8953
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

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

24 Jan 2019, 15:22

After looking at some old YouTube videos, I now remember this bar. I've never really used it so much... I hope it goes well haha :b
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
User avatar
Drugwash
Posts: 850
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

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

24 Jan 2019, 15:42

I used to have three such toolbars on my 98SE, with the taskbar at the top (it's always at the top on all of my computers). There was a time when my desktop was completely devoid of icons; even 'My computer' - which cannot be removed from it on Win9x - was "hidden" by using a blank icon and a 'blank' character for its name (Chr 160). Those toolbars used to provide links to the most used applications. All of them, including taskbar, had 'autohide' on, so the whole desktop was available for applications. Old habit, coming from a longtime usage of a 12" monitor. ;)

Unfortunately all my attempts to create a BaseBar failed so far. There's probably a reason why that window class - among others - is reserved for system use only. But I do have one running on this system and it'd be nice to find a way to save icon positions manually (together with QuickLaunch's) because lately I'm getting too many BSODs and rearranging icons is a pain (this system is never shut down or rebooted except for accidents).
Part of my AHK work can be found here.
User avatar
joedf
Posts: 8953
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

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

24 Jan 2019, 16:01

Maybe you can provide a memory dump, to find out whats causing the BSODs ?
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
User avatar
Drugwash
Posts: 850
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

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

25 Jan 2019, 09:32

I do have a few minidumps, not sure if they're of any use. Didn't Nir Sofer create some utility to read such files or am I mistaken?
Anyway, here you are:
Minidump.7z
(53.51 KiB) Downloaded 299 times
However, in my area there also are frequent power blackouts and although I have a couple UPSes they just can't handle it so even if BSODs are fixed at times I may still get shutdown and those settings get lost.

Thank you for getting so deep involved in trying to help me, it's much appreciated! :thumbup:
Part of my AHK work can be found here.
User avatar
joedf
Posts: 8953
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

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

27 Jan 2019, 16:31

Seems to be a firewall driver issue? fwdrv.sys
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
User avatar
Drugwash
Posts: 850
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

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

27 Jan 2019, 17:37

Thank you so much! I'm not even using the darn thing, it's been disabled the whole time, but apparently that's a kernel driver that still gets loaded and running nonetheless. I've disabled that driver now and will uninstall Kerio soon. Strange though why it started crashing just now because I've had it installed (and disabled) for a longer time. Maybe it clashes with some newly installed driver. Oh well, mysteries of the M$ universe…

As for those toolbars, their settings might reside either in a hidden area of the registry, in some encrypted form or in some file on the drive, because a search for one shortcut's name in the registry came up dry. They had to make it complicated. :(
Part of my AHK work can be found here.
iPhilip
Posts: 822
Joined: 02 Oct 2013, 12:21

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

28 Jan 2019, 17:43

iPhilip wrote:
09 Jul 2018, 18:27
Hi Folks,

Can this script be adapted to get the dimensions of the icons as well, perhaps through LVM_GETSUBITEMRECT? Ultimately, I am trying to find a way to get the name of the icon under the mouse.

Thank you,

iPhilip
Hi Folks,

I developed a solution to the above issue and posted it here.

Cheers!
Windows 10 Pro (64 bit) - AutoHotkey v2.0+ (Unicode 64-bit)
User avatar
joedf
Posts: 8953
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

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

31 Jan 2019, 19:09

@Drugwash classic microsoft :b
@iPhilip nice work!
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: No registered users and 234 guests