flip209 Posted April 29, 2008 Share Posted April 29, 2008 This randomliy moves icons on your desktop to random positions #include <GuiListView.au3> WinActivate("Program Manager") WinWaitActive("Program Manager") $shift = 0 HotKeySet("{EsC}", "_EXIT") _Random_Icon_Move(100) Func _exit() Exit EndFunc ;==>_exit Func _Random_Icon_Move($sleep = 3000) ;Walk the listview items, saving their positions to the DSI file. While 1 $hWnd_LV = ControlGetHandle("[CLASS:Progman]", "", "SysListView321") $nIdx = Random(0, _GUICtrlListView_GetItemCount($hWnd_LV) - 1, 1) $x = Random(0, @DesktopWidth - 30) $y = Random(0, @DesktopHeight - 30) $aPos = _GUICtrlListView_GetItemPosition($hWnd_LV, $nIdx) _GUICtrlListView_SetItemPosition($hWnd_LV, $nIdx, $x, $y) Sleep($sleep) WEnd EndFunc ;==>_Random_Icon_Move " I haven't failed. I've just found 10,000 ways that won't work." Thomas Edison "You cannot help men permanently by doing for them what they could and should do for themselves." Abraham Lincoln Link to comment Share on other sites More sharing options...
James Posted April 29, 2008 Share Posted April 29, 2008 OK this is annoying... I think you have a habit of making joke scripts ^^. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
flip209 Posted April 29, 2008 Author Share Posted April 29, 2008 (edited) It is not a habit it is an addiction. lol ..... Edited April 29, 2008 by flip209 " I haven't failed. I've just found 10,000 ways that won't work." Thomas Edison "You cannot help men permanently by doing for them what they could and should do for themselves." Abraham Lincoln Link to comment Share on other sites More sharing options...
monoceres Posted April 29, 2008 Share Posted April 29, 2008 I found moving icons to be rather fun so I gave it a shot to, it makes the icons foat around and bounce, well sort of: expandcollapse popup#include <GuiListView.au3> #include <array.au3> Global $hWnd_LV = ControlGetHandle("[CLASS:Progman]", "", "SysListView321") Global $icons[_GUICtrlListView_GetItemCount($hWnd_LV)][5] ; 0=id,1=xpos,2=ypos,3=xdir,4=ydir For $i = 0 To UBound($icons, 1) - 1 $icons[$i][0] = $i $temp = _GUICtrlListView_GetItemPosition($hWnd_LV, $i) $icons[$i][1] = $temp[0] $icons[$i][2] = $temp[1] $icons[$i][3] = Random(-1, 1) * 5 $icons[$i][4] = Random(-1, 1) * 5 Next $backup=$icons _ArrayDisplay($backup) WinActivate("Program Manager") WinWaitActive("Program Manager") HotKeySet("{EsC}", "_EXIT") While 1 Sleep(1) For $i = 0 To UBound($icons, 1) - 1 $icons[$i][1] += $icons[$i][3] $icons[$i][2] += $icons[$i][4] _Iconmove($icons[$i][0], $icons[$i][1], $icons[$i][2]) If $icons[$i][1] <= 0 And $icons[$i][3]<0 Then ;Or $icons[$i][3] *= -1 ElseIf $icons[$i][1] >= @DesktopWidth - 30 And $icons[$i][3]>0 Then $icons[$i][3] *= -1 EndIf If $icons[$i][2] <= 0 Or $icons[$i][2] >= @DesktopHeight - 30 Then $icons[$i][4] *= -1 EndIf For $j=0 To UBound($icons, 1) - 1 If $j<>$i Then If $icons[$i][1]+30>=$icons[$j][1] And $icons[$i][1]<=$icons[$j][1]+30 And $icons[$i][2]+30>=$icons[$j][2] And $icons[$i][2]<=$icons[$j][2]+30 Then $icons[$i][3]*=-1 $icons[$i][1]+=$icons[$i][3] $icons[$j][3]*=-1 $icons[$j][1]+=$icons[$i][3] If ($icons[$i][2]>0 And $icons[$j][2]<0) Or ($icons[$i][2]<0 And $icons[$j][2]>0) Then $icons[$i][4]*=-1 $icons[$j][4]*=-1 EndIF EndIf EndIf Next Next WEnd Func _exit() For $t=0 To UBound($backup,1)-1 _Iconmove($backup[$t][0],$backup[$t][1],$backup[$t][2]) Next Exit EndFunc ;==>_exit Func _Iconmove($id, $x, $y) _GUICtrlListView_SetItemPosition($hWnd_LV, $id, $x, $y) EndFunc ;==>_Iconmove Ps. You have to have "Arrange to grid" (Or whatever it's called in english) disabled Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
flip209 Posted April 29, 2008 Author Share Posted April 29, 2008 I found moving icons to be rather fun so I gave it a shot to, it makes the icons foat around and bounce, well sort of: expandcollapse popup#include <GuiListView.au3> #include <array.au3> Global $hWnd_LV = ControlGetHandle("[CLASS:Progman]", "", "SysListView321") Global $icons[_GUICtrlListView_GetItemCount($hWnd_LV)][5] ; 0=id,1=xpos,2=ypos,3=xdir,4=ydir For $i = 0 To UBound($icons, 1) - 1 $icons[$i][0] = $i $temp = _GUICtrlListView_GetItemPosition($hWnd_LV, $i) $icons[$i][1] = $temp[0] $icons[$i][2] = $temp[1] $icons[$i][3] = Random(-1, 1) * 5 $icons[$i][4] = Random(-1, 1) * 5 Next $backup=$icons _ArrayDisplay($backup) WinActivate("Program Manager") WinWaitActive("Program Manager") HotKeySet("{EsC}", "_EXIT") While 1 Sleep(1) For $i = 0 To UBound($icons, 1) - 1 $icons[$i][1] += $icons[$i][3] $icons[$i][2] += $icons[$i][4] _Iconmove($icons[$i][0], $icons[$i][1], $icons[$i][2]) If $icons[$i][1] <= 0 And $icons[$i][3]<0 Then ;Or $icons[$i][3] *= -1 ElseIf $icons[$i][1] >= @DesktopWidth - 30 And $icons[$i][3]>0 Then $icons[$i][3] *= -1 EndIf If $icons[$i][2] <= 0 Or $icons[$i][2] >= @DesktopHeight - 30 Then $icons[$i][4] *= -1 EndIf For $j=0 To UBound($icons, 1) - 1 If $j<>$i Then If $icons[$i][1]+30>=$icons[$j][1] And $icons[$i][1]<=$icons[$j][1]+30 And $icons[$i][2]+30>=$icons[$j][2] And $icons[$i][2]<=$icons[$j][2]+30 Then $icons[$i][3]*=-1 $icons[$i][1]+=$icons[$i][3] $icons[$j][3]*=-1 $icons[$j][1]+=$icons[$i][3] If ($icons[$i][2]>0 And $icons[$j][2]<0) Or ($icons[$i][2]<0 And $icons[$j][2]>0) Then $icons[$i][4]*=-1 $icons[$j][4]*=-1 EndIF EndIf EndIf Next Next WEnd Func _exit() For $t=0 To UBound($backup,1)-1 _Iconmove($backup[$t][0],$backup[$t][1],$backup[$t][2]) Next Exit EndFunc ;==>_exit Func _Iconmove($id, $x, $y) _GUICtrlListView_SetItemPosition($hWnd_LV, $id, $x, $y) EndFunc ;==>_Iconmove Ps. You have to have "Arrange to grid" (Or whatever it's called in english) disabled I like.... " I haven't failed. I've just found 10,000 ways that won't work." Thomas Edison "You cannot help men permanently by doing for them what they could and should do for themselves." Abraham Lincoln Link to comment Share on other sites More sharing options...
spudw2k Posted May 1, 2008 Share Posted May 1, 2008 (edited) Conversly, here's a script that saves your icon locations to an ini file and restores them when an ini is present. I got tired of having to re-arrange my icons everytime I did remote desktop from a machine with a lower resolution. Enjoy. Of course there are some limitations, such as icons created after the ini file has been will not be affected. Was thinking of adding an append icon to ini function. Edit: Discovered that with the latest version of Win 10 I am running that the original script no longer works due to window name changes. Updated code below Tested on Win10x64 1709 #AutoIt3Wrapper_UseX64 = Y #include <GuiListView.au3> $inifile = "IconFreezer.ini" $hWnd = WinWait("[CLASS:WorkerW]", "FolderView", 5) $hWnd_LV = ControlGetHandle($hWnd,"FolderView","SysListView321") If Not FileExists($inifile) Then _SaveIcons() Else _RestoreIcons() EndIf Func _SaveIcons() FileClose(FileOpen($inifile,2)) For $i = 0 to _GUICtrlListView_GetItemCount($hWnd_LV) - 1 $iconposx = _GUICtrlListView_GetItemPositionX($hWnd_LV,$i) $iconposy = _GUICtrlListView_GetItemPositionY($hWnd_LV,$i) $iconname = _GUICtrlListView_GetItemText($hWnd_LV,$i) IniWriteSection($inifile,$iconname,"X=" & $iconposx & @LF & "Y=" & $iconposy) Next EndFunc Func _RestoreIcons() For $i = 0 To _GUICtrlListView_GetItemCount($hWnd_LV) - 1 $iconpos = IniReadSection($inifile,_GUICtrlListView_GetItemText($hWnd_LV,$i)) If IsArray($iconpos) Then $iconposx = _GUICtrlListView_GetItemPositionX($hWnd_LV,$i) $iconposy = _GUICtrlListView_GetItemPositionY($hWnd_LV,$i) If $iconposx <> $iconpos[1][1] Or $iconposy <> $iconpos[2][1] Then _GUICtrlListView_SetItemPosition($hWnd_LV, $i, $iconpos[1][1], $iconpos[2][1]) EndIf $iconpos = 0 Next EndFunc Old code Spoiler #include <GuiListView.au3> $inifile = "IconFreezer.ini" WinActivate("Program Manager") WinWaitActive("Program Manager") $hWnd_LV = ControlGetHandle("[CLASS:Progman]","","SysListView321") If Not FileExists($inifile) Then _SaveIcons() Else _RestoreIcons() EndIf Func _SaveIcons() FileClose(FileOpen($inifile,2)) For $i = 0 to _GUICtrlListView_GetItemCount($hWnd_LV) - 1 $iconposx = _GUICtrlListView_GetItemPositionX($hWnd_LV,$i) $iconposy = _GUICtrlListView_GetItemPositionY($hWnd_LV,$i) $iconname = _GUICtrlListView_GetItemText($hWnd_LV,$i) IniWriteSection($inifile,$iconname,"X=" & $iconposx & @LF & "Y=" & $iconposy) Next EndFunc Func _RestoreIcons() For $i = 0 To _GUICtrlListView_GetItemCount($hWnd_LV) - 1 $iconpos = IniReadSection($inifile,_GUICtrlListView_GetItemText($hWnd_LV,$i)) If IsArray($iconpos) Then $iconposx = _GUICtrlListView_GetItemPositionX($hWnd_LV,$i) $iconposy = _GUICtrlListView_GetItemPositionY($hWnd_LV,$i) If $iconposx <> $iconpos[1][1] Or $iconposy <> $iconpos[2][1] Then _GUICtrlListView_SetItemPosition($hWnd_LV, $i, $iconpos[1][1], $iconpos[2][1]) EndIf $iconpos = 0 Next EndFunc Edited February 20, 2019 by spudw2k Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
toxicvn Posted October 24, 2008 Share Posted October 24, 2008 I can check any key was Pressed in my keyboard many the timess: ex:i Press "a" then Press "u" . . . it write " text.txt" inside have all key what i Pressed thank very much Link to comment Share on other sites More sharing options...
Cw2K1 Posted October 24, 2008 Share Posted October 24, 2008 it's a useless script which can be used to get troubles yourself Enjoy the complexity.Feel the power of simplicity. Link to comment Share on other sites More sharing options...
muncherw Posted October 29, 2008 Share Posted October 29, 2008 it's a useless script which can be used to get troubles yourself I've had a lot of fun with it at the office. Another tech and I are constantly messing with each other...it didn't take him two seconds to realize this one was me but it still was fun. Other People's Stuff:Andy Flesner's AutoIt v3: Your Quick Guide[topic="34302"]Locodarwin's ExcelCom_UDF[/topic][topic="61090"]MrCreatorR's Opera Library[/topic] Link to comment Share on other sites More sharing options...
youknowwho4eva Posted October 29, 2008 Share Posted October 29, 2008 you should move all his stuff to a hidden folder (I don't mean an actual hidden folder but an invisible folder), see how long it takes him to get that one. Giggity Link to comment Share on other sites More sharing options...
Prashant Posted August 22, 2009 Share Posted August 22, 2009 Kinda weired and annoying Script..Forum is being Corrupted coz, of those kind of Scripts..Although,thx its interesting. >_ Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now