Sign in to follow this  
Followers 0
oneLess

[solved] move desktop icon[s]

6 posts in this topic

#1 ·  Posted (edited)

i press search button a lot , but i cant find something i need :

i want a function to run when i press a button

who move a desktop link/url system or not [if exist the link] to another position .

like , after a fresh XP install , move recycle bin link , on last column , second line [if the place is free]

no matter desktop resolution.

can be done something like that ? [without save icons positions & restore scripst] ?

Edited by oneLess

Share this post


Link to post
Share on other sites

#2 ·  Posted (edited)

Look here

Note: core is in this:

#include <A3LListView.au3>

Global $hwnd = ControlGetHandle("[CLASS:Progman]","","SysListView321")

...

Func RestorePositions()
    Local $data,$i,$n = 1
    If Not FileExists(@MyDocumentsDir & "\iconsave.txt") Then Exit

        While 1
        $data = FileReadLine(@MyDocumentsDir & "\iconsave.txt",$n)
        If @error Then ExitLoop
        $n += 1
        $data = StringSplit($data,",")
        $i = ControlListView("","",$hwnd,"FindItem",$data[1])
        If $i = -1 Then ContinueLoop
        _ListView_SetItemPosition($hwnd,$i,$data[2],$data[3])
    WEnd
EndFunc
Edited by Zedna

Share this post


Link to post
Share on other sites

thank you Zedna for the answer.

but i want to move the shortcut , from place A in place B anywhere on desktop,

where place B wasnt recorded before with a third pary software.

also suppose the shortcut never was before in place B [like i said after first boot on fresh xp install]

i wish also to verify if place B is free [no other shortcut there]

can be done this ? or maybe i missunderstand the core you pointed ?

Share this post


Link to post
Share on other sites

All needed functions/API are in the above example.

Just use them in little reorganized way.

Instead of demanding for finished code

you may look at given code and try to do/learn something yourself.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

thank you again @Zedna

when i said

i want a function to run...

i do not intend to

demanding for finished code

you pointed me in the right direction [ nice parameters in your sample :D ]

so SOLVED !

this script do not restore anything

the script simply move the preferred icons in preferred positions , no more than that , saving your time to arrange them.

ANY number of icons MOVED in ANY place on desktop ANY time

NO MATTER names

NO MATTER XP language

NO MATTER resolution

NO MATTER autohide taskbar

NO MATTER hide file extension

JUST dont tick ARRANGE Desktop by Auto-arrange

THANK YOU

@MsCreatoR [Desktop Icons Restorator]

@trids [iconMap, Save and Restore multiple desktop icon layouts]

@PaulIA [ListView UDFs]

autoIT

code autoIT attached below [3c_iconitze_2.au3]

exe sample attached below [3c_iconitze_2.exe]

3c_iconitze.au3 is a library , i used it as a library for my main application

i run it

;----------------------------------------------------------------------------
    #include <3c_iconitze.au3>
    #include <File.au3>
;----------------------------------------------------------------------------
;----------------------------------------------------------------------------
;WinMove ( "[CLASS:#32770]" , "Internet" , @DesktopWidth - 100 , @DesktopHeight - 175 ); <- i use bitdefender
        WinMinimizeAll ( )
;GUISetState ( @SW_MINIMIZE )       ; <-- my main application
        Sleep (250) 
        SoundPlay ( @WindowsDir & "\media\notify.wav", 0 )
    _arrange_preferred_icon ( )
        WinMinimizeAllUndo ( )
;GUISetState ( @SW_RESTORE )        ; <-- my main application
;_set_status ( "rearrage icons" )       ; <-- my main application
;_MsgBox_dont_click ( "IE7" , "Desktop Icons Rearranged" , 1 ); <-- my main application
;----------------------------------------------------------------------------

the script work for me with

[1.] autoIT 3.2.8.1

[2.] ListView UDFs so , you must install Auto3Lib Installer

[pay attention to the solution for the error "auto3Lib requires at least version 3.2.4.9 of AutoIt"]

and

[3.] one function [Func _Write_DSI_Session($sFile)] from [Desktop Icons Restorator], for saving in a file current positions for all icon on desktop

i named this library Desktop_Icons_Restorator_needed_part.au3 , attached below

and

[4.] THREE libraries from [Desktop Icons Restorator] [A3LListView.au3/A3LHeader.au3/A3LMemory.au3]

attached at this post

put the four libraries [3.] and [4.] in a Resources folder

and run from 3c_iconitze.au3 the function _arrange_preferred_icon ( )

at first run will create a inifile in %windir%\Debug named 3c_icons.ini

[Setup]
My Documents=x_first,y_first,forward
My Computer=x_first+1,y_first,forward
Recycle Bin=x_first+1,y_first+1,forward
My Network Places=x_first,y_first+1,forward
NuMaUita=x_first+2,y_first+2,forward
BitDefender*=x_first+1,y_last,forward
Nero*=x_first,y_last,forward
*Word*=x_last,y_first+1,backward
*Excel*=x_last-1,y_first+1,backward
*PowerPoint*=x_last-1,y_first,backward
*Publisher*=x_last-2,y_first,backward
*Access*=x_last,y_first,backward
Winamp*=x_first,y_last-2,forward
Zuma Deluxe=x_last,y_last,backward
BS*Player*=x_first,y_last-1,forward
*PowerDVD*=x_first+1,y_last-1,forward
Alcohol*=x_first,y_last-3,forward
3c_updater*.*=x_first+3,y_first+3,forward
RDS=x_first+4,y_first,forward
PPPoE_confi*=x_first+5,y_first,forward

here you can delete/add/modify the entries with your preferences.

[first four entries must be translated in your native language.]

YOU DO NOT NEED TO INSTALL ALL STUFF ABOVE ,

THE EXE FILE WILL DO ALL FOR YOU ,

ALL TO DO IS MODIFYING PROPERLY THE INI FILE.

i wrote enough , i will continue if i will see any interest in that .

i will have time to test it in my uA DVD only next week .

Edited by oneLess

Share this post


Link to post
Share on other sites

....trim...

YOU DO NOT NEED TO INSTALL ALL STUFF ABOVE ,

THE EXE FILE WILL DO ALL FOR YOU ,

ALL TO DO IS MODIFYING PROPERLY THE INI FILE.

i wrote enough , i will continue if i will see any interest in that .

i will have time to test it in my uA DVD only next week .

Hello. I'm just starting out trying to do things using AutoIt and this is pretty much exactly what i've been trying to do.

Is there any chance the attachments or at least the .exe are still available?

TIA for any help.

Al

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