News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Dip (Desktop Icon Positioner)

Started by jimg, January 13, 2018, 04:43:08 AM

Previous topic - Next topic

jimg

       Dip  -  Desktop Icon Positioner  -  by Jim Giordano

  This code and program released to the public domain for any purpose.

  This program allows you to position the icons on your desktop precisely using the keyboard cursor keys or a mouse.

  You may select one or more icons from the listview.  If you click on a direction arrow, you may then move them as a unit one pixel at a time with either the mouse or keyboard.  You may also enter an X or Y coordinate for them, or enter a delta to space them out.
 
  For large movements, you may move the items directly on the desktop as usual, and when you return, the new positions will be updated in the Dip table for fine adjustment.
 
  You may restore the positions of any icons to the position they had when Dip was started.

  You may sort on any column in the listview, for example X or Y to make lining up rows or columns easier.

  You may save many different layouts as desired, for example, one for each
   screen resolution.  Note that positions are absolute pixels on screen.  If
   you use scaling for your screen (display setting/scaling), then you should
   indicate the scaling used in your layout name so there is no confusion.
   If you use a layout from a different scaling, your icons will appear spread
   out or condensed on screen.  Temporarily change to scaling to match and then
   rescale as desired and save a new layout.
 
  There are no entries made in the registry.  Each copy of Dip is self-contained in it's own folder as desired.
   
  If Auto Arrange and or Align to Grid are set, the program will make it's best attempt at unsetting them, and updating the registry so that they will not be set upon bootup.

Unattended options:
     If you enter a known switch on the command line, Dip will set the icon
     positions and exit.  Options are -r key  or  -d   for saved default.
     Key is the name you entered when you selected menu option
              File/Save to user supplied key
    e.g.              
     Dip -r 1024x768
     Dip /d
     Dip -r "big key name with embeded blanks"
Notes:

This program should work on any version of Windows NT.   Windows 98 support has been removed.

I use this as a workhorse program so it could use some work cosmetically.

There are many other programs that do a similar job, so try some others too.

p.s.  Please use at your own risk and take backups.  Windows 10 is so flakey, there's no telling what the next update will do.

Downloads of previous version: 141
Last update 8/25/19


jimg

#1
New release above.  Many, many changes.

Combined versions for 32bit and 64bit windows.
Rewrote 32bit detection scheme.
Now searches through all windows for the desktop listview so it can find it even if hidden in one of the Worker windows rather than in Progman as usual.
Fixed icons.  Since windows no longer stores the icon information within the listview in a usable manner, the icons are now retrieved from the Desktop folder.  Still unable to associate the correct icon to the system icon (Recycle bin, This PC, etc) so they are currently blank.
Fixed control sizing that went astray with windows 10.
Lots of cleanup of this program written 17 years ago as one of my first Masm/Windows programs.  (I've learned a little since then, I think.)  Still can use a lot more cleanup, but should be fully functional.

Added commandline options to restore from a user created key.

     If you enter a known switch on the command line, Dip will set the icon
     positions and exit.  Options are -r key  or  -d   for saved default.
     Key is the name you entered when you selected menu option
              File/Save to user supplied key
    e.g.              
     Dip -r 1024x768
     Dip -d
     Dip /r "big key name with embeded blanks"


Edit:  Updated 4/22/18
  Somewhere in all the cut and paste, I lost the option to highlight a group of icons on the desktop and have then selected in the dip listview as soon as you return to dip.   Fixed.

At some point, microsoft change the desktop listview menu items (auto arrange and align to grid) by moving the ampersand and changing some characters from upper case to lower case.  Updated to strip ampersands and search non case sensitive.  Should be able to turn off auto arrange and align to grid in most cases now.  If not, you will have to turn them off manually.

Changed Dip.reg to only add dip to the right click context menu for the desktop, not folders and files.  If you previously used it you will have to remove them from the registry manually as I'm not deleting anything from your registry.  Just search for "dip.exe".  Also, if you use the reg file, change the path inside to point to where you put Dip!
To make a quick restore to default context menu item, add this to Dip.reg

[HKEY_CLASSES_ROOT\Directory\Background\shell\Dip Restore Default\command]
@="E:\\Progs\\Dip\\Dip.exe -d"

change "Dip Restore Default" to whatever you want, and again, change the path as needed.

Edit: 4/24/18:
When run for the first time after a reboot, it was taking up to ten seconds to read in the icons from the files in the desktop folder, so I added a progress window if it takes more than 1/2 second to read the files.  If you see a brief flash of a window at startup, that is probably what it was.

Edit: 8/20/19
Fixed strange occurrences when saving layouts.
Added ability to delete layouts.

Edit: 8/25/19
Now allows two desktop.ini files.

jimg

Update:
Fixed strange occurrences when saving layouts.
Added ability to delete layouts.

sinsi

Wow, lots of code there  :dazzled:

It doesn't seem to like two icons with the same name - they both show the same position (first image), moving by even 1 pixel it disappears from the screen.
Resetting the position makes it work properly (second image).

If you're not interested in XP or earlier versions I have some code using shell interfaces.
🍺🍺🍺

jimg

#4
Thanks Sinsi-
I'll look into a hack for two icons named the same.
I've sent a personal message.
Edit.   deleted my earlier ignorant response.

jimg

Update above.  Now allows duplicate icon names (i.e. desktop.ini).  Note that the first one will always be the one from USER and the second will be the one from PUBLIC.   Windows 10 won't even let you manually move USER to the right of PUBLIC.