Sign in to follow this  
Followers 0
youknowwho4eva

Extended Desktop

28 posts in this topic

#1 ·  Posted (edited)

I had seen a script not to long back on how to move the icons on the desktop, which gave me an idea. I've got two tiny monitors, and I'm a desktop hog. Everything I save or do is on the desktop. I only have like 3 spots left. And instead of going through all the files and folders and organizing and blahdy blah, I decided to make my desktop bigger. No I didn't add a 3rd monitor. I made it so I can scroll past the extents of my monitor. Now I've cheated for my dual monitor, but left it set up for one. Eventually I'll make it so one script supports both unless someone wants to do that for me.

Right now if you move your mouse 20 pixels from the edge of you monitor, your desktop will move in the inverse direction. Tada hidden space you didn't know you had.

Future Enhancements.

-Well I gotta make it so when I create a new icon, that it can go below the monitor. Right now they can go to the right of the monitor, but won't be auto created below.

-Set limits so you don't lose your desktop in desktop world, also have a pull back to top left function (Pull back created! pres escape to exit, and return to the way it was)

-Right now, if you use the task bar it will move, maybe I'll make it so you have to hold shift to scroll your desktop. (Added!!!)

-No sleep in the while loop makes it cpu hungry. This pretty much is a draft that needs more work to be less of a CPU hog, but I tested it and loved it, and wanted to share (I think it's at least better)

-The dual and single monitor support thingy

-I don't like the space between icons... maybe I'll make a way to shrink that too... maybe even add a gui

- As I type this a load more of ideas pop into my head, so I'm going to finish up by posting the code before I have a fatal brain storm.

I forget who I saw make the code for moving the recycle bin, that I borrowed to make this, but thanks. Once I find the post again I'll add you on here.

CODE
#Include <GuiListView.au3>

#include <Array.au3>

#Include <Misc.au3>

HotKeySet("{ESC}","close")

; Get desktop handle

$hDeskTop = ControlGetHandle( "Program Manager", "", "SysListView321" )

; Save the listview items (icons) data to an array

count()

Func count()

Global $oldcount = _GUICtrlListView_GetItemCount($hdesktop)

Global $aIcons[_GUICtrlListView_GetItemCount($hDeskTop)][3]

Global $bIcons[_GUICtrlListView_GetItemCount($hDeskTop)][3]

Global $dll = DllOpen("user32.dll")

For $i = 0 to _GUICtrlListView_GetItemCount($hDeskTop) - 1

; Name

$bIcons[$i][0] = _GUICtrlListView_GetItemText($hDeskTop, $i)

$bPos = _GUICtrlListView_GetItemPosition($hDeskTop, $i)

; Left

$bIcons[$i][1] = $bPos[0]

; Top

$bIcons[$i][2] = $bPos[1]

$bIcons[0][0] = $i

Next

EndFunc

While 1

If _IsPressed("10", $dll) = 0 Then

For $i = 0 to _GUICtrlListView_GetItemCount($hDeskTop) - 1

; Name

$aIcons[$i][0] = _GUICtrlListView_GetItemText($hDeskTop, $i)

$aPos = _GUICtrlListView_GetItemPosition($hDeskTop, $i)

; Left

$aIcons[$i][1] = $aPos[0]

; Top

$aIcons[$i][2] = $aPos[1]

$aIcons[0][0] = $i

Next

If _GUICtrlListView_GetItemCount($hdesktop) > $oldcount Then count()

Sleep(10)

ElseIf _IsPressed("10", $dll) = 1 Then

$mouse = MouseGetPos()

If $mouse[0] < 20 or $mouse[0] > @DesktopWidth - 20 or $mouse[1] < 20 or $mouse[1] > @DesktopHeight - 20 then

For $i = 0 To $aIcons[0][0]

If $mouse[0] < 20 Then

$aIcons[$i][1] += 5

_GUICtrlListView_SetItemPosition($hDeskTop, $i, $aIcons[$i][1],$aicons[$i][2])

EndIf

If $mouse[0] > @DesktopWidth - 20 Then

$aIcons[$i][1] -= 5

_GUICtrlListView_SetItemPosition($hDeskTop, $i, $aIcons[$i][1],$aicons[$i][2])

EndIf

If $mouse[1] <20 Then

$aIcons[$i][2] += 5

_GUICtrlListView_SetItemPosition($hDeskTop, $i, $aIcons[$i][1],$aicons[$i][2])

EndIf

If $mouse[1] > @DesktopHeight - 20 Then

$aIcons[$i][2] -= 5

_GUICtrlListView_SetItemPosition($hDeskTop, $i, $aIcons[$i][1],$aicons[$i][2])

EndIf

; Wait a bit

Next

EndIf

EndIf

;~ Sleep(1)

WEnd

Func close()

For $i = 0 To $bIcons[0][0]

If $mouse[0] < 20 Then

_GUICtrlListView_SetItemPosition($hDeskTop, $i, $bIcons[$i][1],$bicons[$i][2])

EndIf

If $mouse[0] > @DesktopWidth - 20 Then

_GUICtrlListView_SetItemPosition($hDeskTop, $i, $bIcons[$i][1],$bicons[$i][2])

EndIf

If $mouse[1] <20 Then

_GUICtrlListView_SetItemPosition($hDeskTop, $i, $bIcons[$i][1],$bicons[$i][2])

EndIf

If $mouse[1] > @DesktopHeight - 20 Then

_GUICtrlListView_SetItemPosition($hDeskTop, $i, $bIcons[$i][1],$bicons[$i][2])

EndIf

; Wait a bit

Next

Exit

EndFunc

Edit: added some of the enhancements I wanted to add.

Edited by youknowwho4eva

Giggity

Share this post


Link to post
Share on other sites



How about tabs? In the top left, and so that it pops down when you mouse over there...

I actually have an incredibly organised desktop, all my icons are actually clsids... but thats another story. My dad is just like you though! :)

Oh and... It didn't work! Maybe its my icons being stupid but, I did what I should do, and it did something (Lots of flashing icons), but no removal of any of them.

MDiesel

Share this post


Link to post
Share on other sites

Do you have auto arrange or grids on?

I was thinking something along the lines of collapsing like file types. So when you mouse over, or click say a jpeg icon, it drops down a list of jpegs.

My problem is I'm working on a computer that the person in my position before had his own method of organization or lack there of. So I have a daunting task of figuring out a method of organization that works for me and incorporates the before methods. Really I have to go through a lot of files and figure out what exactly it is, and figure a way to organize it all so I can find it.


Giggity

Share this post


Link to post
Share on other sites

Grids...

Taken them off and it works now. Still a bit on the slow side, and you see a sort of mexican wave of flashing icons! Also doesnt' quite restore accurately, not sure why that is happening...

MDiesel

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

It's slow because it moves each icon individually. In my case it's a lot. If I can figure a way to move them as a group it'll be quicker, I'll look into it.

The restore is my fault :) I copied the move function and changed all the a's to b's, but left in there the move increments.

Edit: fixed first post restore.

Edited by youknowwho4eva

Giggity

Share this post


Link to post
Share on other sites

How about you move them a fixed distance, right now power is more important than getting a nice "Slide" affect. You could make it so it jumps to the next place with grids on, that would be ok... About those tabs too... instead - how about a progressbar that shows where you are at? I knew something was wrong with the restore :) I just couldn't find it in the script at first glance.

MDiesel

Share this post


Link to post
Share on other sites

I was thinking similar to that. I was thinking an iPod Touch/iPhone slide. With that you have black dots at the bottom indicating the number of pages, and the white dot is the active page. I'm working on a better slide effect.


Giggity

Share this post


Link to post
Share on other sites

I know I know, it's not an AutoIt script but it sounds like you desperately need something like this:

http://virtuawin.sourceforge.net/

WBD

Share this post


Link to post
Share on other sites

I know I know, it's not an AutoIt script but it sounds like you desperately need something like this:

http://virtuawin.sourceforge.net/

WBD

It's not autoit script.

LOL couldn't resist. Trying the tab idea now......


0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

I like this idea alot.

I might have missed it, but do these off-screen positions save if you shutdown?

Also, would it be easier to hide the actual desktop and create a listview on a new GUI rather than moving icons on a listview outside of your program? (just throwing out an idea, may not be viable at all)

Just thought it might be easier to do something with an internal listview as a fake desktop.

Really nice though :)

Edited by crashdemons

My Projects - WindowDarken (Darken except the active window) Yahsmosis Chat Client (Discontinued) StarShooter Game (Red alert! All hands to battlestations!) YMSG Protocol Support (Discontinued) Circular Keyboard and OSK example. (aka Iris KB) Target Screensaver Drive Toolbar Thingy Rollup Pro (Minimize-to-Titlebar & More!) 2D Launcher physics example Ascii Screenshot AutoIt3 Quine Example ("Is a Quine" is a Quine.) USB Lock (Another system keydrive - with a toast.)

Share this post


Link to post
Share on other sites

beleve me crating a listview that supports the correct icons you have on desktop is a mess, and i didn't ever finished it, there are always some icons that don't display correct.

for example if you just read the ico from an exe what do you do with documents?

if you use the global icon cache, some native icons don't work, and to decide which one is the correct icon to dosplay on this listview, is like hell.

i would love the idea changing the style of the procman listview to list or detailed.

there is already a solution here in the forum ( don't remember where), but this gets screwed by pressing F5 on the desktop.

anyone an idea?


$a=StringSplit("547275737420796F757220546563686E6F6C75737421","")For $b=1 To UBound($a)+(-1*-1*-1)step(2^4/8);&$b+=1*2/40*µ&Asc(4)Assign("c",Eval("c")&Chr(Dec($a[$b]&$a[$b+1])))''Chr("a")&"HI"Next;time_U&r34d,ths,U-may=get$the&c.l.u.e;b3st-regards,JRSmile;MsgBox(0x000000,"",Eval("c"));PiEs:d0nt+*b3.s4d.4ft3r.1st-try:-)

Share this post


Link to post
Share on other sites

Does just using _guictrllistview_getitemimage and setitemimage not work? I'm going to try some more things today to see if I can't get something working external of progman. I did play with controlsetpos, put it acts very odd. It would flash the desk top but not move anything until a guictrllistview_setitemposition was used, then it would move the control to where you specified, and do the setitemposition you specified. I'm sure one of us will find a way to make it behave properly.


Giggity

Share this post


Link to post
Share on other sites

Sorry to bump but wanted to update where I am at know and look for a little help for progression. Right now I pull the same icon for all items. I'm ecstatic that I got that far. So now what I'd like to do is put the text under the icon, which I think I may be able to do. Fully expand the columns, another probably easy. I don't have a mess of experience with list view so I've got a little curve to learn it. The big thing will be finding the proper path to the icons. I've been doing searches, but haven't seen anything promising yet. I think I've seen something with changing I think the recycle bin icon, which may prove promising.

CODE
#Include <GuiListView.au3>

#include <Array.au3>

#Include <Misc.au3>

#Include <GuiImageList.au3>

HotKeySet("{ESC}","close")

$hProgMan = WinGetHandle("Program Manager")

$progmanpos = WinGetPos($hProgman)

$hDeskTop = ControlGetHandle( "Program Manager", "", "SysListView321" )

$desktoppos = ControlGetPos($hprogman,"",$hdesktop)

Global $oldcount = _GUICtrlListView_GetItemCount($hdesktop)

Global $aIcons[_GUICtrlListView_GetItemCount($hDeskTop)][4]

Global $bIcons[_GUICtrlListView_GetItemCount($hDeskTop)][4]

Global $dll = DllOpen("user32.dll")

$images=_GUIImageList_Create(30,30)

For $i = 0 to _GUICtrlListView_GetItemCount($hDeskTop) - 1

; Name

$bIcons[$i][0] = _GUICtrlListView_GetItemText($hDeskTop, $i)

$bPos = _GUICtrlListView_GetItemPosition($hDeskTop, $i)

; Left

$bIcons[$i][1] = $bPos[0]

; Top

$bIcons[$i][2] = $bPos[1]

_GUIImageList_AddIcon($images,@SystemDir & "\shell32.dll",146)

$bIcons[0][0] = $i

Next

$fuxdesktop = GUICreate("Fux Desktop",$progmanpos[2] - $progmanpos[0], $progmanpos[3] - $progmanpos[1], $progmanpos[0], $progmanpos[1])

$desktop2 = GUICtrlCreateListView(" | ", $desktoppos[0] , $desktoppos[1],$desktoppos[2] - $desktoppos[0] ,$desktoppos[3] - $desktoppos[1])

_GUICtrlListView_SetImageList($desktop2,$images,1)

_GUICtrlListView_SetExtendedListViewStyle($desktop2,$lvs_ex_subitemimages)

GUISetState()

For $i = 0 to $bIcons[0][0]

_GUICtrlListView_AddItem($desktop2,$bIcons[$i][0],1)

_GUICtrlListView_SetItemImage($fuxdesktop,$i,$bIcons[$i][3],1)

Next

While 1

$mouse = MouseGetPos()

If _IsPressed("10", $dll) = 0 Then

For $i = 0 to _GUICtrlListView_GetItemCount($hDeskTop) - 1

; Name

$aIcons[$i][0] = _GUICtrlListView_GetItemText($hDeskTop, $i)

$aPos = _GUICtrlListView_GetItemPosition($hDeskTop, $i)

; Left

$aIcons[$i][1] = $aPos[0]

; Top

$aIcons[$i][2] = $aPos[1]

$aIcons[0][0] = $i

Next

If _GUICtrlListView_GetItemCount($hdesktop) > $oldcount Then count()

Sleep(10)

ElseIf _IsPressed("10", $dll) = 1 Then

If $mouse[0] < 20 or $mouse[0] > @DesktopWidth*2 - 20 or $mouse[1] < 20 or $mouse[1] > @DesktopHeight - 20 then

For $i = 0 To $aIcons[0][0]

If $mouse[0] < 20 Then

$aIcons[$i][1] += 5

_GUICtrlListView_SetItemPosition32($hDeskTop, $i, $aIcons[$i][1],$aicons[$i][2])

EndIf

If $mouse[0] > @DesktopWidth*2 - 20 Then

$aIcons[$i][1] -= 5

_GUICtrlListView_SetItemPosition32($hDeskTop, $i, $aIcons[$i][1],$aicons[$i][2])

EndIf

If $mouse[1] <20 Then

$aIcons[$i][2] += 5

_GUICtrlListView_SetItemPosition32($hDeskTop, $i, $aIcons[$i][1],$aicons[$i][2])

EndIf

If $mouse[1] > @DesktopHeight - 20 Then

$aIcons[$i][2] -= 5

_GUICtrlListView_SetItemPosition32($hDeskTop, $i, $aIcons[$i][1],$aicons[$i][2])

EndIf

; Wait a bit

Next

EndIf

EndIf

;~ Sleep(1)

WEnd

Func close()

For $i = 0 To $bIcons[0][0]

If $mouse[0] < 20 Then

_GUICtrlListView_SetItemPosition($hDeskTop, $i, $bIcons[$i][1],$bicons[$i][2])

EndIf

If $mouse[0] > @DesktopWidth - 20 Then

_GUICtrlListView_SetItemPosition($hDeskTop, $i, $bIcons[$i][1],$bicons[$i][2])

EndIf

If $mouse[1] <20 Then

_GUICtrlListView_SetItemPosition($hDeskTop, $i, $bIcons[$i][1],$bicons[$i][2])

EndIf

If $mouse[1] > @DesktopHeight - 20 Then

_GUICtrlListView_SetItemPosition($hDeskTop, $i, $bIcons[$i][1],$bicons[$i][2])

EndIf

; Wait a bit

Next

Exit

EndFunc


Giggity

Share this post


Link to post
Share on other sites

i played a bit with your example and this is what i got :)

#Include <GuiListView.au3>
#include <Array.au3>
#Include <Misc.au3>
HotKeySet("{ESC}","close")
$hDeskTop = ControlGetHandle("Program Manager", "", "SysListView321" )
$Max = 20 ; the max value to move the icons at one time
$Range = 180 ; range from the margins of the screen to move the icons
Global $dll
count()
Func count()
    Global $oldcount = _GUICtrlListView_GetItemCount($hdesktop)
    Global $aIcons[_GUICtrlListView_GetItemCount($hDeskTop)][3]
    Global $bIcons[_GUICtrlListView_GetItemCount($hDeskTop)][3]
    Global $dll = DllOpen("user32.dll")
    For $i = 0 to _GUICtrlListView_GetItemCount($hDeskTop) - 1
        ; Name
        $bIcons[$i][0] = _GUICtrlListView_GetItemText($hDeskTop, $i)
        $bPos = _GUICtrlListView_GetItemPosition($hDeskTop, $i)
        ; Left
        $bIcons[$i][1] = $bPos[0]
        ; Top
        $bIcons[$i][2] = $bPos[1]
        $bIcons[0][0] = $i
    Next
EndFunc
While 1
    If Not WinActive("Program Manager") Then
        Sleep(100)
        ContinueLoop
    EndIf
    If _IsPressed("10", $dll) = 0 Then
        For $i = 0 to _GUICtrlListView_GetItemCount($hDeskTop) - 1
            ; Name
            $aIcons[$i][0] = _GUICtrlListView_GetItemText($hDeskTop, $i)
            $aPos = _GUICtrlListView_GetItemPosition($hDeskTop, $i)
            ; Left
            $aIcons[$i][1] = $aPos[0]
            ; Top
            $aIcons[$i][2] = $aPos[1]
            $aIcons[0][0] = $i
            Sleep(1)
        Next
        If _GUICtrlListView_GetItemCount($hdesktop) > $oldcount Then count()
    ElseIf _IsPressed("10", $dll) = 1 Then
        While _IsPressed("10" , $dll) = 1
            $mouse = MouseGetPos()
            If $mouse[0] < $Range or $mouse[0] > @DesktopWidth - $Range or $mouse[1] < $Range or $mouse[1] > @DesktopHeight - $Range then
                For $i = 0 To $aIcons[0][0]
                    If $mouse[0] < $Range Then
                        $aIcons[$i][1] += ($Range-$mouse[0])/$Range*$Max
                    EndIf
                    If $mouse[0] > @DesktopWidth - $Range Then
                        $aIcons[$i][1] -= ($mouse[0]-@DesktopWidth+$Range)/$Range*$Max
                    EndIf
                    If $mouse[1] < $Range Then
                        $aIcons[$i][2] += ($Range-$mouse[1])/$Range*$Max
                    EndIf
                    If $mouse[1] > @DesktopHeight - $Range Then
                        $aIcons[$i][2] -= ($mouse[1]-@DesktopHeight+$Range)/$Range*$Max
                    EndIf
                    _GUICtrlListView_SetItemPosition($hDeskTop, $i, $aIcons[$i][1],$aicons[$i][2])
                    ; Wait a bit
                Next
            EndIf
            Sleep(1)
        WEnd
    EndIf
    Sleep(100)
WEnd
Func close()
    For $i = 0 To $bIcons[0][0]
        _GUICtrlListView_SetItemPosition($hDeskTop, $i, $bIcons[$i][1],$bicons[$i][2])
    Next
    Exit
EndFunc

Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro

Share this post


Link to post
Share on other sites

i played a bit with your example and this is what i got :)

#Include <GuiListView.au3>
#include <Array.au3>
#Include <Misc.au3>
HotKeySet("{ESC}","close")
$hDeskTop = ControlGetHandle("Program Manager", "", "SysListView321" )
$Max = 20 ; the max value to move the icons at one time
$Range = 180 ; range from the margins of the screen to move the icons
Global $dll
count()
Func count()
    Global $oldcount = _GUICtrlListView_GetItemCount($hdesktop)
    Global $aIcons[_GUICtrlListView_GetItemCount($hDeskTop)][3]
    Global $bIcons[_GUICtrlListView_GetItemCount($hDeskTop)][3]
    Global $dll = DllOpen("user32.dll")
    For $i = 0 to _GUICtrlListView_GetItemCount($hDeskTop) - 1
        ; Name
        $bIcons[$i][0] = _GUICtrlListView_GetItemText($hDeskTop, $i)
        $bPos = _GUICtrlListView_GetItemPosition($hDeskTop, $i)
        ; Left
        $bIcons[$i][1] = $bPos[0]
        ; Top
        $bIcons[$i][2] = $bPos[1]
        $bIcons[0][0] = $i
    Next
EndFunc
While 1
    If Not WinActive("Program Manager") Then
        Sleep(100)
        ContinueLoop
    EndIf
    If _IsPressed("10", $dll) = 0 Then
        For $i = 0 to _GUICtrlListView_GetItemCount($hDeskTop) - 1
            ; Name
            $aIcons[$i][0] = _GUICtrlListView_GetItemText($hDeskTop, $i)
            $aPos = _GUICtrlListView_GetItemPosition($hDeskTop, $i)
            ; Left
            $aIcons[$i][1] = $aPos[0]
            ; Top
            $aIcons[$i][2] = $aPos[1]
            $aIcons[0][0] = $i
            Sleep(1)
        Next
        If _GUICtrlListView_GetItemCount($hdesktop) > $oldcount Then count()
    ElseIf _IsPressed("10", $dll) = 1 Then
        While _IsPressed("10" , $dll) = 1
            $mouse = MouseGetPos()
            If $mouse[0] < $Range or $mouse[0] > @DesktopWidth - $Range or $mouse[1] < $Range or $mouse[1] > @DesktopHeight - $Range then
                For $i = 0 To $aIcons[0][0]
                    If $mouse[0] < $Range Then
                        $aIcons[$i][1] += ($Range-$mouse[0])/$Range*$Max
                    EndIf
                    If $mouse[0] > @DesktopWidth - $Range Then
                        $aIcons[$i][1] -= ($mouse[0]-@DesktopWidth+$Range)/$Range*$Max
                    EndIf
                    If $mouse[1] < $Range Then
                        $aIcons[$i][2] += ($Range-$mouse[1])/$Range*$Max
                    EndIf
                    If $mouse[1] > @DesktopHeight - $Range Then
                        $aIcons[$i][2] -= ($mouse[1]-@DesktopHeight+$Range)/$Range*$Max
                    EndIf
                    _GUICtrlListView_SetItemPosition($hDeskTop, $i, $aIcons[$i][1],$aicons[$i][2])
                    ; Wait a bit
                Next
            EndIf
            Sleep(1)
        WEnd
    EndIf
    Sleep(100)
WEnd
Func close()
    For $i = 0 To $bIcons[0][0]
        _GUICtrlListView_SetItemPosition($hDeskTop, $i, $bIcons[$i][1],$bicons[$i][2])
    Next
    Exit
EndFunc
I couldn't get it to do anything.

Giggity

Share this post


Link to post
Share on other sites

I couldn't get it to do anything.

lol... click on the desktop and press shift.. then move the mouse to the corners

Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro

Share this post


Link to post
Share on other sites

ah, now I see


Giggity

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

This works for me (using WinMove easily with Auto-arrange and Grid off)

You can also use the speed option on winmove if you REALLY want to

You could use ControlMove, but once you have the handle, you can treat it like a window to a certain extent.

Example:

Global $hDesk, $aStartDim
$hDesk=ControlGetHandle("Program Manager", "", "SysListView321")
$aStartDim=WinGetPos($hDesk)
$aCurrentDim=$aStartDim

$aCurrentDim[0]-=50; move 50px left
$aCurrentDim[2]+=50; add 50px to width
_DesktopMove_Set()
Sleep(10000); give you time to play with the icons.

_DesktopMove_Restore()




Func _DesktopMove_Set()
    WinMove($hDesk,'',$aCurrentDim[0],$aCurrentDim[1],$aCurrentDim[2],$aCurrentDim[3])
EndFunc
Func _DesktopMove_Restore()
    WinMove($hDesk,'',$aStartDim[0],$aStartDim[1],$aStartDim[2],$aStartDim[3])
EndFunc
Func OnAutoItExit ( )
    _DesktopMove_Restore()
EndFunc

This was just to show that I can give you 50px extra space temporarily in a different manner - you can obviously edit it to give an amount that is controlled by the user.

The background drawing will have to be refreshed somehow, as it messes up - looks fine with no background image though.

Edited by crashdemons

My Projects - WindowDarken (Darken except the active window) Yahsmosis Chat Client (Discontinued) StarShooter Game (Red alert! All hands to battlestations!) YMSG Protocol Support (Discontinued) Circular Keyboard and OSK example. (aka Iris KB) Target Screensaver Drive Toolbar Thingy Rollup Pro (Minimize-to-Titlebar & More!) 2D Launcher physics example Ascii Screenshot AutoIt3 Quine Example ("Is a Quine" is a Quine.) USB Lock (Another system keydrive - with a toast.)

Share this post


Link to post
Share on other sites

#19 ·  Posted (edited)

your example proved usefull.

This makes a 3 x 3 grid of desktops, gives you 9 times the space.

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.0.0
 Author:         myName

 Script Function:
    Template AutoIt script.

#ce ----------------------------------------------------------------------------
Opt("MouseCoordMode",1)
#include <misc.au3>
; Script Start - Add your code below here
HotKeySet("{ESC}","foo")

Global $hDesk, $aStartDim
Global $dll = DllOpen("user32.dll")
$hDesk=ControlGetHandle("Program Manager", "", "SysListView321")
;~ $hDesk=ControlGetHandle("Program Manager", "", "SysListView321")
$aStartDim=WinGetPos($hDesk)
$aCurrentDim=$aStartDim

$speed = 9
$border = 26


$aCurrentDim[0]-= $aStartDim[2]
$aCurrentDim[1]-= $aStartDim[3]
$aCurrentDim[2] = $aStartDim[2] * 3
$aCurrentDim[3] = $aStartDim[3] * 3
_DesktopMove_Set()

While 1
    If WinActive("Program Manager") Then

;~       While _IsPressed("10" , $dll) = 1
            $mouse = MouseGetPos()
            If $mouse[0] < $border Then
                $aCurrentDim[0]+= ($border - $mouse[0])/(10 - $speed)
            ElseIf $mouse[0] > (@DesktopWidth - $border) Then
                $aCurrentDim[0]+= ((@DesktopWidth - $border) - $mouse[0]) / (10 - $speed)
                
            ElseIf $mouse[1] < $border Then
                $aCurrentDim[1]+= ($border - $mouse[1])/(10 - $speed)
            ElseIf $mouse[1] > (@DesktopHeight - $border) Then
                $aCurrentDim[1]+= ((@DesktopHeight - $border) - $mouse[1]) / (10 - $speed)
            EndIf
            _DesktopMove_Set()
;~       WEnd

    EndIf
    Sleep(100)
WEnd

Func foo()
    _DesktopMove_Restore()
    Exit
EndFunc

Func _DesktopMove_Set()
    WinMove($hDesk,'',$aCurrentDim[0],$aCurrentDim[1],$aCurrentDim[2],$aCurrentDim[3])
EndFunc
Func _DesktopMove_Restore()
    WinMove($hDesk,'',$aStartDim[0],$aStartDim[1],$aStartDim[2],$aStartDim[3])
EndFunc
Func OnAutoItExit ( )
    _DesktopMove_Restore()
EndFunc
;~   WinMove($hDesk,'',0,0,1024,768)

will update with added fetures, such as:

Limits to edges - Right now, if you bring a object off the edge of the desktop, it falls in your recycle bin.(better then crashing tho)

smootheing / tidying - make it more efficient

Quick view - Hold middle mouse button, and it will let you "drag"

Another couple things that i noticed is that if you make items in a spot not useally available to you, and make it normal sise, it will still keep those files. Make it big again and you can acceuss them. Interesting....

Edited by corgano

0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e

Share this post


Link to post
Share on other sites

#20 ·  Posted (edited)

@corgano - here's my edit of your script:

simplified the border checking a bit...

(speed change gradients may not be exactly the same)

limited the view to the actual 3x3 grid (I think *rubs eyes*)

- meaning you can't move to outside of the defined 3x3 area.

And the part that annoyed me - the viewing area is now initially in the upper left instead of the middle

(your icons start in the upper left)

PS: you had your mouse-button checking commented out... (?)

so I disregarded them; you should be able to add them back to this in the same areas.

Opt("MouseCoordMode",1)
HotKeySet("{ESC}","foo")

Global $hDesk, $aStartDim, $aCurrentDim
$hDesk=ControlGetHandle("Program Manager", "", "SysListView321")
$aStartDim=WinGetPos($hDesk)
$aCurrentDim=$aStartDim

$speed = 9
$border = 26

$minx=-$aStartDim[2]*2
$miny=-$aStartDim[3]*2
$aCurrentDim[2] *=3
$aCurrentDim[3] *=3
$maxx=0
$maxy=0

_DesktopMove_Set()

$borderr=@DesktopWidth - $border
$borderb=@DesktopHeight - $border

While 1
    If WinActive("Program Manager") Then
        $mouse=MouseGetPos()
        Select
            Case $mouse[0] < $border
                $aCurrentDim[0]+= 4*($border -$mouse[0])/$speed
            Case $mouse[0] > $borderr
                $aCurrentDim[0]+= 4*($borderr-$mouse[0])/$speed
            Case $mouse[1] < $border
                $aCurrentDim[1]+= 4*($border -$mouse[1])/$speed
            Case $mouse[1] > $borderb
                $aCurrentDim[1]+= 4*($borderb-$mouse[1])/$speed
        EndSelect
        _DesktopMove_Set()
    EndIf
    Sleep(100)
WEnd

Func foo()
    _DesktopMove_Restore()
    Exit
EndFunc

Func _DesktopMove_Set()
    $aCurrentDim[0]=iLimit($aCurrentDim[0], $minx, $maxx)
    $aCurrentDim[1]=iLimit($aCurrentDim[1], $miny, $maxy)
    WinMove($hDesk,'',$aCurrentDim[0],$aCurrentDim[1],$aCurrentDim[2],$aCurrentDim[3])
EndFunc
Func _DesktopMove_Restore()
    WinMove($hDesk,'',$aStartDim[0],$aStartDim[1],$aStartDim[2],$aStartDim[3])
EndFunc
Func OnAutoItExit ( )
    _DesktopMove_Restore()
EndFunc
Func iLimit($i, $n, $x)
    If $i<$n Then Return $n
    If $i>$x Then Return $x
    Return $i
EndFunc
Edited by crashdemons

My Projects - WindowDarken (Darken except the active window) Yahsmosis Chat Client (Discontinued) StarShooter Game (Red alert! All hands to battlestations!) YMSG Protocol Support (Discontinued) Circular Keyboard and OSK example. (aka Iris KB) Target Screensaver Drive Toolbar Thingy Rollup Pro (Minimize-to-Titlebar & More!) 2D Launcher physics example Ascii Screenshot AutoIt3 Quine Example ("Is a Quine" is a Quine.) USB Lock (Another system keydrive - with a toast.)

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