 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
holomind
Joined: 11 Mar 2006 Posts: 341 Location: Munich, Germany
|
Posted: Mon Oct 09, 2006 9:15 am Post subject: |
|
|
@lazlo: this workarea detection is more stable
but is not tested on dualmonitor systems. but it alwyas correctly finds my taskbar (either locked or not), i use my taskbar on right side.
| Code: |
DetectScreen:
WinGetPos,Tx,Ty,Tw,Th,ahk_class Shell_TrayWnd,,,
Sw := A_ScreenWidth
Sh := A_ScreenHeight
; Define Work-Area (adjust Taskbar position)
Wy := ( Tw > Th and Tx = 0 and Ty = 0) * Th
Wx := ( Tw < Th and Tx = 0 and Ty = 0) * Tw
Wh := Sh - ( Tw > Th ) * Th
Ww := Sw - ( Tw < Th ) * Tw
Return
|
|
|
| Back to top |
|
 |
matula
Joined: 07 Mar 2008 Posts: 5
|
Posted: Fri Mar 07, 2008 7:24 pm Post subject: funny |
|
|
this is exactly what i'm using, except i don't ever change the width just height and position, and i pass some pixels off screen, so the borders go out.
something like:
| Code: |
#Persistent
#SingleInstance
SetTimer, IdleTimerCheck, 10000
IdleTimerCheck:
SysGet, Mon1, MonitorWorkarea
winSnapHeightPerTwo = %Mon1Bottom%
winSnapHeightPerTwo //= 2
winSnapHeightPerTwo+=3
return
#Numpad4::
SysGet, Mon1, MonitorWorkarea
winSnapHeight = %Mon1Bottom%
winSnapHeight+=6 ;12 mplayer
WinMove, A, , -5, -3, , winSnapHeight ;-15,-8 mplayer
return
#Numpad6::
SysGet, Mon1, MonitorWorkarea
winSnapHeight = %Mon1Bottom%
winSnapHeight+=6
WinGetPos , , , winWidth, , A
winFinalpos = %Mon1Right%
winFinalpos-=%winWidth%
WinMove, A, , winFinalpos, -3, , winSnapHeight
return
#Numpad2::
SysGet, Mon1, MonitorWorkarea
;MsgBox, Left: %Mon1Left% -- Top: %Mon1Top% -- Right: %Mon1Right% -- Bottom %Mon1Bottom%
WinMove, A, , , winSnapHeightPerTwo-3, , winSnapHeightPerTwo
return
#Numpad8::
SysGet, Mon1, MonitorWorkarea
;MsgBox, Left: %Mon1Left% -- Top: %Mon1Top% -- Right: %Mon1Right% -- Bottom %Mon1Bottom%
WinMove, A, , , -3, , winSnapHeightPerTwo
return
ExitSub:
{
}
ExitApp
|
it makes more sense to me. |
|
| Back to top |
|
 |
Chicken Pie 4 Tea
Joined: 18 Aug 2009 Posts: 375 Location: holland
|
Posted: Fri Oct 29, 2010 3:49 pm Post subject: |
|
|
I hate scripts that use the numpad, a lot of us have laptops  _________________ "Choose your parents wisely" |
|
| Back to top |
|
 |
matula
Joined: 07 Mar 2008 Posts: 5
|
Posted: Fri Oct 29, 2010 5:36 pm Post subject: |
|
|
| "HelloWorld" wrote: | | I hate ...:evil: |
get a proper laptop then! |
|
| Back to top |
|
 |
holomind
Joined: 11 Mar 2006 Posts: 341 Location: Munich, Germany
|
Posted: Fri Oct 29, 2010 6:02 pm Post subject: |
|
|
| "HelloWorld" wrote: | I hate scripts that use the numpad, a lot of us have laptops  |
Not so quick my friend, this script was developed on a laptop without numpad !!!! if you read the key-definitions you will notice they can be operated with windows-right-arrow, windows-left-arrow. i think # stand for windows-key.
you can assign any one you like easily. if you compare it with the original script in the first post. somebody was lazy and just used numpad.
or get a nice keyremapper and emulate your numpad.
also even on most laptops you can operate the numpad if you press the fn-key and the blue/gray colored numbers on your keys.
or just get windows 7, then you just drag your window to the screenborder and it does the same
have fun with the script and dont complain
holomind |
|
| Back to top |
|
 |
Chicken Pie 4 Tea
Joined: 18 Aug 2009 Posts: 375 Location: holland
|
Posted: Sat Oct 30, 2010 10:08 am Post subject: |
|
|
Thanks Holomind, I hadnt noticed that you could use the script without a numpad. Its just that I come across so many window moving scripts that use the keypad only and I thought this was yet another.
By the way I have never taken any notice of those blue keys you mention - so I have learned something earthshattering
well, dont complain about my complaining as it had the effect of bumbing this topic back to the first page  |
|
| Back to top |
|
 |
digdug78 Guest
|
Posted: Thu Jun 30, 2011 5:50 pm Post subject: Split-screen script for multiple monitor setup |
|
|
I run a 6x multi-monitor of 1920x1200 pixels. This works well for me. Win-Numpad1-9 (1,3,7,9 fills quarter screen, 2,4,6,8 fills half screen, 5 maximizes or restores window). Win-' moves window to the next monitor.
| Code: |
SysGet, MonitorCount, MonitorCount
Loop, %MonitorCount%
{
SysGet, Monitor, Monitor, %A_Index%
if (MinX > MonitorLeft)
MinX := MonitorLeft
If (MaxX < MonitorLeft)
MaxX := MonitorLeft
if (MinY > MonitorTop)
MinY := MonitorTop
If (MaxY < MonitorTop)
MaxY := MonitorTop
}
MinX = 10000
MinY = 10000
MaxX = -10000
MaxY = -10000
SysGet, MonitorCount, MonitorCount
Loop, %MonitorCount%
{
SysGet, Monitor, Monitor, %A_Index%
if (MinX > MonitorLeft)
MinX := MonitorLeft
If (MaxX < MonitorLeft)
MaxX := MonitorLeft
if (MinY > MonitorTop)
MinY := MonitorTop
If (MaxY < MonitorTop)
MaxY := MonitorTop
}
#NumPad7::WinResize( 0, 0,.5,.5)
#NumPad9::WinResize(.5, 0,.5,.5)
#NumPad1::WinResize( 0,.5,.5,.5)
#NumPad3::WinResize(.5,.5,.5,.5)
#NumPad2::WinResize( 0,.5, 1,.5)
#NumPad8::WinResize( 0, 0, 1,.5)
#NumPad4::WinResize( 0, 0,.5, 1)
#NumPad6::WinResize(.5, 0,.5, 1)
#NumPad5::
WinGet, MX, MinMax, A
If MX
WinRestore A
Else WinMaximize A
return
#'::
WinGetPos,X,Y,,,A
If (X < MinX or X >= (MaxX+A_ScreenWidth) )
X := MinX
If (Y < MinY or Y >= (MaxY + A_ScreenHeight) )
Y := MinY
If (X < MaxX)
X := X + A_ScreenWidth
Else
{
X := X - (MaxX-MinX)
If (Y < MaxY)
Y := Y + A_ScreenHeight
Else
Y := Y - A_ScreenHeight
}
WinMove, A,,X,Y
MouseMove X+100,Y+100
Return
|
|
|
| Back to top |
|
 |
ni.va
Joined: 30 Oct 2011 Posts: 5
|
Posted: Sun Oct 30, 2011 11:15 am Post subject: |
|
|
Hi Thanks for the amazing scripts. but How can I add a hotkey to Cascade Active Window??
Thanks again for your help... |
|
| Back to top |
|
 |
ni.va
Joined: 30 Oct 2011 Posts: 5
|
Posted: Sun Oct 30, 2011 11:26 am Post subject: |
|
|
| holomind wrote: |
| Code: |
#SingleInstance force
SysGet m, MonitorWorkArea
mW := mRight-mLeft
mH := mBottom-mTop
#Numpad7::WinMove, A,, mLeft ,mTop ,mW/2 ,mH/2 ; Top Left H H
#Numpad8::WinMove, A,, mLeft ,mTop ,mW ,mH/2 ; Top F H
#Numpad9::WinMove, A,, mLeft+mW/2 ,mTop ,mW/2 ,mH/2 ; Top Right H H
#Numpad4::WinMove, A,, mLeft ,mTop ,mW/2 ,mH ; Left H F
#Numpad5::WinMove, A,, mLeft+mW/4 ,mTop ,mW/2 ,mH ; Center H F
#Numpad6::WinMove, A,, mLeft+mW/2 ,mTop ,mW/2 ,mH ; Right H F
#Numpad1::WinMove, A,, mLeft ,mTop+mH/2 ,mW/2 ,mH/2 ; Bottom Left H H
#Numpad2::WinMove, A,, mLeft ,mTop+mH/2 ,mW ,mH/2 ; Bottom H F
#Numpad3::WinMove, A,, mLeft+mW/2 ,mTop+mH/2 ,mW/2 ,mH/2 ; Bottom Right H H
#NumpadEnter::WinMove, A,, mLeft ,mTop ,mW ,mH ; Full F F
|
|
| holomind wrote: |
| Code: |
DetectScreen:
WinGetPos,Tx,Ty,Tw,Th,ahk_class Shell_TrayWnd,,,
Sw := A_ScreenWidth
Sh := A_ScreenHeight
; Define Work-Area (adjust Taskbar position)
Wy := ( Tw > Th and Tx = 0 and Ty = 0) * Th
Wx := ( Tw < Th and Tx = 0 and Ty = 0) * Tw
Wh := Sh - ( Tw > Th ) * Th
Ww := Sw - ( Tw < Th ) * Tw
Return
|
|
Can you Combine these two scripts for me?? I am dummy in scripting & want a low sized script to use... any help would be greatly appreciated |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|