StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Register | Active Topics
Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Lua Scripts
 General Action Scripts
 Set window to screen side
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Kingron

39 Posts

Posted - 03/03/2012 :  02:14:59  Show Profile  Reply with Quote
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)
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000