Jump to content

How to lock icons on desktop?


E1M1
 Share

Recommended Posts

How to lock icons placement on desktop?

I tried this http://www.activewin.com/tips/reg/desktop_3.shtml but it didn't work, I am wondering if there are any other methods to do it.

I tried

;~ ControlEnable("Program Manager", "", "[CLASS:SysListView32; INSTANCE:1]")
but it completely disables desktop ;)

I also thought about changing Style for SysListView32 in window Program Manager, but I can't find how to change style for non autoit window elements.

Also i am not sure if that helps me but if it helps I would need someone's help on changing that style.

Edit: I just tested commercial software and found that it don't change style. any ideas about how it could work?

edit2: I saw it use HookManager.dll I am just wondering what is hook and how it works and can i write autoit script that installs kinda hook in that window.

Edited by E1M1

edited

Link to comment
Share on other sites

  • Moderators

E1M1,

I have been looking for something like this for a long time, as I was so fed up with Vista messing up the arrangement of the icons on my desktop and in my folders. But I never found any way to fix them where I wanted them. :evil:

In the end I wrote a small utility that saves the positions of the icons when they are at the positions I want and which then moves them back to these positions if Bill Gates has messed them about. If I remember correctly, it uses _GUICtrlListView_GetItemCount, _GUICtrlListView_GetItemText and _GUICtrlListView_GetItemPosition to save the icon positions once you have identified the Explorer ListView. It was not difficult to write. ;)

M23

P.S. I will see if I can find the script for you later.

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Well It's pretty good solution, and it's easy if you knowwho and what u do but if that code includes commands that u never used before and u even don't know about the then it could take weeks.

Can't you just monitor for mouse left down action and if mousedrag detected, press esc(it's good solution if u have set things open with single click).

edited

Link to comment
Share on other sites

  • Moderators

E1M1,

Can't you just monitor for mouse left down action and if mousedrag detected, press esc

I think I may have misunderstood what you wanted. Are you just looking to prevent the icons being slightly moved when you click on them and move the mouse inadvertantly?

If so, then try setting the <Align to Grid> option which will snap them back automatically if you move them slightly when clicking on them. You will find it (in Vista at least) by rightclicking on the DeskTop and looking under the <View> item. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

P.S. I will see if I can find the script for you later.

I would be happy if you'll post your script ;). Used MrCreatoR's Desktop Icons Restorator before. But recently I've switched to x64 and had to learn that x86 compiled scripts can not access x64 system listviews :evil:. Tried to update the script, but it has been written in AU 3.2.4.9, and quiet a bunch has changed since then, so it looked more like a total re-write... and I've been too lazy to do that up to now :evil: Edited by KaFu
Link to comment
Share on other sites

  • Moderators

KaFu,

I thought someone might take me up on that offer - so I went searching.... ;)

You need a recursive file searcher to make it work, so I have also attached my version which is an #include in the utility. There is also the icon I produced (I was always poor at art, so do not laugh too much :evil: ).

Warning: This works on Vista 32-bit, but apparently certain sections fail on any other OS. Caveat emptor!

I think the operation is fairly obvious:

Get your desktop/folders as you would wish and then press "Save". I have found it best to have all the folders closed before running. The "Desktop only" checkbox limits the save as it suggests.

Pressing "Restore" resets all the values as saved. If icons are moved, you are told and are advised to check the folders "View" setting - it is usually there that Vista has changed something - before continuing. I have also found that it is s good idea to actually move at least one icon in a changed folder before letting the app replace the icons - it seems to get confused if the icons are autoarranged when it starts. It also lets you know if it finds an icon with no stored location - a hint that you need to save a new config file! :evil:

"Delete" lets you get rid of previously saved configurations. I decided to offer the chance to save several versions as I know some people use different resolutions at times.

The config files are saved in the same folder as the utility unless it is placed in the "Program Files" folder - in this case they are stored in @AppDataDir & "\ICF". But this is transparent to the user.

As always, happy to receive comments and suggestions.

M23

Edit: Zip updated after KaFu's improvements.

Edited by Melba23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

As always, happy to receive comments and suggestions.

Really nice ;), thanks a bunch! I started something similar in this thread, but why invent the wheel twice :evil:?

Compiling this with x64 version of AU does the job for me!

Sliding through the code I saw this line twice:

$sConfig_Name = @ScriptDir & "\" & $aConfig_List[$iIndex]

which should not work If @ScriptDir = @ProgramFilesDir, better like this

$sConfig_Name = $sConfig_Path & "\" & $aConfig_List[$iIndex]

This

Global $sDesktop_Path = "C:\Users\" & @UserName & "\Desktop"

should better be this

Global $sDesktop_Path = @DesktopDir

I changed this

Global $aIniSection_List = _RecFileListToArray($sDesktop_Path, "*", 2, 1)

to this

Global $aIniSection_List = _RecFileListToArray($sDesktop_Path, "*", 2, 1)
$aIniSection_List_Common =  _RecFileListToArray(@DesktopCommonDir, "*", 2, 1)
if IsArray($aIniSection_List_Common) Then
    $aIniSection_List[0] += $aIniSection_List_Common[0]
    _ArrayDelete($aIniSection_List_Common,0)
    _ArrayConcatenate($aIniSection_List,$aIniSection_List_Common)
    $aIniSection_List_Common = 0
endif

and will add a command-line switch to restore certain configs (I want to use it with ATI Hotkeys to switch between PC and TV desktop layout :evil:).

Link to comment
Share on other sites

Link to comment
Share on other sites

  • Moderators

KaFu,

Glad you liked it! ;)

Thanks for the improvements. I wrote it quite some time ago and have not really looked at it since - a second pair of eyes is always a good idea.

I have updated the zip above if anyone else wants the amended version.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...