As we know, Windows 7 already have two feature, set window to left side of the screen and right side of the screen, we just drag & drop the window title bar to screen left side or right side, Windows will set the window to left part or right part, but it doesn't support top side or bottom side, so let's wrote some script to do this.
I set four Gesture: <, > ^, V to do this, each action list below 1. For < Gesture (Windows 7 or higher only): acSendKeys("{DELAY=50}@{LEFT}")
2. For > Gesture (Windows 7 or higher only): acSendKeys("{DELAY=50}@{RIGHT}")
3. For ^ gesture: -- Set window to top side local mh= acGetMonitorFromPoint(gsx, gsy) local top = acGetMonitorTop(mh, true) local left = acGetMonitorLeft(mh, true) local right = acGetMonitorRight(mh, true) local bottom = acGetMonitorBottom(mh, true)
acRestoreWindow(nil, gsx, gsy) acMoveWindow(nil, gsx, gsy, left, top) acSetWindowSize(nil, gsx, gsy, right - left, (bottom - top) / 2)
4. For V gesture: -- Set window to bottom side local mh= acGetMonitorFromPoint(gsx, gsy) local top = acGetMonitorTop(mh, true) local left = acGetMonitorLeft(mh, true) local right = acGetMonitorRight(mh, true) local bottom = acGetMonitorBottom(mh, true)
acRestoreWindow(nil, gsx, gsy) acMoveWindow(nil, gsx, gsy, left, (bottom - top) / 2) acSetWindowSize(nil, gsx, gsy, right - left, (bottom - top) / 2) |