This script demonstrates how to reposition a desktop shortcut and accompanies the following article:
http://www.mjtnet.com/blog/2006/01/19/s ... positions/
//Functions needed for working with windows messages
VBSTART
Function LoWord(wInt)
LoWord = wInt AND &HFFFF&
End Function
Function HiWord(wInt)
HiWord = wInt \ &H10000 AND &HFFFF&
End Function
Function MAKELPARAM(wLow, wHigh)
MAKELPARAM = LoWord(wLow) Or (&H10000 * LoWord(wHigh))
End Function
VBEND
//Refresh icon view
SetFocus>Program Manager
Press F5
//Get index of RealPlayer shortcut on desktop
GetListItem>Program Manager,SysListView32,0,RealPlayer,0,0,0,Result,Handle
//Set position of icon.
//If Align to Grid is on this will slot icon in where it fits best.
//If Align to Grid is off it will place icon at this absolute position.
Let>xpos=100
Let>ypos=500
VBEval>MAKELPARAM(%xpos%,%ypos%),lparam
//Reposition
Let>LVI_SETITEMPOSITION=4111
LibFunc>user32,SendMessageA,r,Handle,LVI_SETITEMPOSITION,Result,lparam
SRT>ToggleAlignToGrid
//Code to toggle Align to Grid
SetFocus>Program Manager
Press MenuKey
Send>il
END>ToggleAlignToGrid
Set the Position of Desktop Shortcuts
Moderators: Dorian (MJT support), JRL, Phil Pendlebury
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Set the Position of Desktop Shortcuts
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?