Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- resizehook(hwnd)
- {
- global id, id0, id1, id2, id3, id4, id5, id6, id7, id8, id9
- global moving
- global X,Y,H,W
- WinGet, id, list
- SetTimer, ResizeWindow, -1
- Loop {
- if (moving == 0) {
- ToolTip
- break
- }
- WinGetPos, X, Y, W, H, ahk_id %hwnd%
- sleep, 10
- }
- }
- resize(this_id)
- {
- global ConfigFile
- IniRead, cont, %ConfigFile%, Group1, %this_id%, 0
- if (cont != 1) {
- return
- }
- global moving
- global X,Y,H,W
- Loop {
- Sleep, 10
- if (moving == 0) {
- break
- }
- WinGetPos, X2, Y2, W2, H2, ahk_id %this_id%
- DX1 := X + W - X2
- DY1 := Y + H - Y2
- DX2 := X2 + W2 - X
- DY2 := Y2 + H2 - Y
- ToolTip, %X%x%Y% %H%x%W% %X2%x%Y2% %H2%x%W2% %DX1%x%DY1% %DX2%x%DY2%, 0, 0
- if (0) {
- if (DX1 < 50) {
- NX := X2 + DX1
- ToolTip, %NX%, 0, 0
- WinMove, ahk_id %this_id%,, NX, Y2, W2, H2
- } else
- if (DY1 < 50) {
- NY := Y2 + DY1
- ToolTip, %NY%, 0, 0
- WinMove, ahk_id %this_id%,, X2, NY, W2, H2
- } else
- if (DX2 < 50) {
- NX := X2 - DX2
- ToolTip, %NX%, 0, 0
- WinMove, ahk_id %this_id%,, NX, Y2, W2, H2
- } else
- if (DY2 < 50) {
- NY := Y2 - DY2
- ToolTip, %NY%, 0, 0
- WinMove, ahk_id %this_id%,, X2, NY, W2, H2
- }
- } else {
- if (DX1 < 50) {
- NX := X2 + DX1
- NW := W2 - DX1
- ToolTip, %NX% %NW%, 0, 0
- WinMove, ahk_id %this_id%,, NX, Y2, NW, H2
- } else
- if (DY1 < 50) {
- NY := Y2 + DY1
- NH := H2 - DY1
- ToolTip, %NY% %NH%, 0, 0
- WinMove, ahk_id %this_id%,, X2, NY, W2, NH
- } else
- if (DX2 < 50) {
- NW := W2 - DX2
- ToolTip, %NX%, 0, 0
- WinMove, ahk_id %this_id%,, X2, Y2, NW, H2
- } else
- if (DY2 < 50) {
- NH := H2 - DY2
- ToolTip, %NY%, 0, 0
- WinMove, ahk_id %this_id%,, X2, Y2, W2, NH
- }
- }
- }
- }
- #Insert::
- WinGet,window,ID,A
- GroupAdd, Docker, ahk_id %window%
- IniWrite, 1, %ConfigFile%, Group1, %window%
- ToolTip, Adding %window%, 0, 0
- Sleep, 1000
- ToolTip
- return
- #Delete::
- WinGet,window,ID,A
- ;GroupAdd, Docker, ahk_group Docker,,,ahk_id %window%
- IniWrite, 0, %ConfigFile%, Group1, %window%
- ToolTip, Removing %window%, 0, 0
- Sleep, 1000
- ToolTip
- return
- ResizeWindow:
- if (!id && !moving) {
- return
- }
- this := id%id%
- resize(this)
- id := id - 1
- SetTimer, ResizeWindow, -1
- return
Add Comment
Please, Sign In to add comment