Sign in to follow this  
Followers 0
windu

tile windows vertically

7 posts in this topic

hello guys, im totally new to autoit but i like the concept..

im a bit stucked on something but im sure autoit veterans can help me out and in fact this might be totally simple, however im missing it. im making simple script the will minimize everything, open two explorers in 'My Computer' and tile them vertically. So far it goes like:

;minimize all
WinMinimizeAll()
;run 2xp on 'my comp'
Run("explorer.exe /n, /e, ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}")
Run("explorer.exe /n, /e, ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}")
;tile them vertically (how?)

..so i dont know how to tile 'em :/

any idea/help appreciated, thanks in advance.. :rolleyes:

Share this post


Link to post
Share on other sites



Use WinMove along with the desktop size macros to place them manually. I don't think there is a way to tile them automatically.

Share this post


Link to post
Share on other sites

ty for quick reply, i used to do this in Delphi by embeding cmdow in main exe, then extract/execute it with "/tv" switch and deleting it after, which i considered to be bit unelegant lol. Will digg out what u've suggested later on but im abs sure there must be some win func to call for this... -_-

thanks for hints Mr Icekirby, much apreciated ! :)

Share this post


Link to post
Share on other sites

I'm a total newbie at COM and have only been experimented a little bit with some basic stuff. Try this UDF :

Func _WinTileVert()
    Local $oShell = ObjCreate("shell.application")
    If NOT IsObj($oShell) Then Return SetError(1)
    
    $oShell.TileVertically
EndFunc

Share this post


Link to post
Share on other sites

/me sets mode: +beer Helge!*@* :-)

cheers man! works like charm.. :rolleyes:

ok, just for the reference if anyone comes to this .. whole script:

;minimize all
WinMinimizeAll()

;run 2xp on 'my comp'
Run("explorer.exe /n, /e, ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}")
Run("explorer.exe /n, /e, ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}")

;tile them vertically
WinWaitActive("My Computer")
_WinTileVert()

;tile.vert function by Helge
Func _WinTileVert()
    Local $oShell = ObjCreate("shell.application")
    If NOT IsObj($oShell) Then Return SetError(1)
   
    $oShell.TileVertically
EndFunc

;eof

thanks again for all the inputs. :rambo:

Share this post


Link to post
Share on other sites

User32.DLL provides a couple of functions with more flexibility:

Run("explorer.exe /n, /e, ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}","", @SW_MAXIMIZE )
Run("explorer.exe /n, /e, ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}","", @SW_MAXIMIZE )
Sleep( 1000 ) 
DllCall( "user32.dll", "int", "CascadeWindows", "int",0, "int",4, "int",0, "int",0, "int",0 ); Cascade
Sleep( 3000 )
DllCall( "user32.dll", "int", "TileWindows", "int",0, "int",1, "int",0, "int",0, "int",0 ); Tile Horizontal
Sleep( 3000 )
DllCall( "user32.dll", "int", "TileWindows", "int",0, "int",0, "int",0, "int",0, "int",0 ); Tile Vertical

I am a newbie and this is my first snippet run in AU3 .. Hope I have put it right.

:rolleyes:

Share this post


Link to post
Share on other sites

great idea Skan & pretty cool effect when u do it one by one like that! :-)

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