AutoHotkey Community

It is currently May 27th, 2012, 11:44 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: May 29th, 2010, 9:48 pm 
Offline

Joined: October 30th, 2009, 1:03 am
Posts: 26
Active window to a side like windows 7 (ON XP) via one button hotkey.

Ive tried to script around
http://www.autohotkey.net/~Fluffy654/
a windows 7 shortcut implementor
WITH THE ABOVE I WOULD NEED
send #Right
EVEN
send #{Right}
WHICH I THINK FAIL because im using
http://www.autohotkey.com/forum/viewtop ... highlight=
which when I move to a corner to trigger I lose focus, maybe....

AND IVE TRIED

WinWaitActive,
WinMove, nAvI, , 0, 0, % A_ScreenWidth/2, %A_ScreenHeight%


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 29th, 2010, 10:20 pm 
Offline

Joined: October 18th, 2007, 9:21 pm
Posts: 343
Location: Saarland, Germany
Try this:
Code:
SysGet, _, MonitorWorkArea
_Width := _Right - _Left, _Height := _Bottom - _Top

; Alt+Ctrl+LeftArrow will move the active window to the left side
!^Left:: WinMove, A,, 0, 0, % _Width//2, %_Height%

; Alt+Ctrl+RightArrow will move the active window to the right side
!^Right::WinMove, A,, % _Width//2+1, 0, % _Width//2, %_Height%

_________________
Wolf

Schön wär's, wenn's schön wär!


Report this post
Top
 Profile  
Reply with quote  
 Post subject: sadly no-go.
PostPosted: May 29th, 2010, 11:18 pm 
Offline

Joined: October 30th, 2009, 1:03 am
Posts: 26
It works w/the hotkeys
OR
if I take out the binding, and just click it IN the window to move
BUT
not with
HOTCORNERS / edge of screen "hotspot" activating the script


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 29th, 2010, 11:25 pm 
Offline

Joined: October 18th, 2007, 9:21 pm
Posts: 343
Location: Saarland, Germany
Code:
SysGet, _, MonitorWorkArea
_Width := _Right - _Left, _Height := _Bottom - _Top

; Win+Ctrl+LeftArrow will move the active window to the left side
^#Left:: WinMove, A,, 1, 1, % _Width//2-1, % _Height-1

; Win+Ctrl+RightArrow will move the active window to the right side
^#Right:: WinMove, A,, % _Width//2+1, 1, % _Width//2-2, % _Height-1

Is that any better? If not how big is your HotSpot, and where exactly? Also how many HotSpots are there?

PS: I use this now myself, so the HotKeys are to suit my preferences, feel free to adjust them to your liking.

_________________
Wolf

Schön wär's, wenn's schön wär!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 31st, 2010, 1:47 am 
Offline

Joined: October 18th, 2007, 9:21 pm
Posts: 343
Location: Saarland, Germany
I herewith openly admit that my previous two posts were offtopic, because I just didn't get what was asked. (I should have read the two linked topics properly)

I believe now that the Tag 1.0.ahk is a sort of Virtual Desktop implementation, and hotcorners don't trigger windows being moved into the corners, but trigger user defined commands, when the MOUSE is moved into a corner.

Hotfoot (author of Hot Corners) wrote:
This script is meant to be modified by the user for individual needs.

I offer to have another look (properly this time) if friend Dinguz could share his code, please. Or maybe offer additional information, how the two scripts interact.

_________________
Wolf

Schön wär's, wenn's schön wär!


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Done.
PostPosted: May 31st, 2010, 3:04 am 
Offline

Joined: October 30th, 2009, 1:03 am
Posts: 26
thanks again for your interest

your original scripts ended up working

is what i ended up using with hotcorners ONLY
trying to "SEND" commands to the WIN7 like program was just complicating it

:oops:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 31st, 2010, 4:47 am 
Offline

Joined: October 18th, 2007, 9:21 pm
Posts: 343
Location: Saarland, Germany
FYI: I also had a look at a similar question in this thread: Gui Maximize without Resize is covering up the Taskbar.

Wolf (in the other thread) wrote:
Imagine the case that User starts your app, then changes the screen resolution. He may also drag the task-bar to the right side, top, or the left side, and vary the height (width when on the side) of the task-bar. He can (dis)allow the task-bar to auto-hide. For all those cases, it is better to place SysGet where it is needed. On XP this looks like: (no more hard coded 0,0 coordinates)


Applying my thoughts, we get:
Code:
;---------------------------------------------------------------------------
#^Left:: ; move the active window to the left side
;---------------------------------------------------------------------------
    Gosub, GetCurrentMonitorWorkArea
    WinMove, A,, _Left, _Top, _Width//2, _Height

Return


;---------------------------------------------------------------------------
#^Right:: ; move the active window to the right side
;---------------------------------------------------------------------------
    Gosub, GetCurrentMonitorWorkArea
    WinMove, A,, _Width//2+1, _Top, _Width//2, _Height

Return


;---------------------------------------------------------------------------
GetCurrentMonitorWorkArea:
;---------------------------------------------------------------------------
    SysGet, _, MonitorWorkArea
    _Width  := _Right - _Left
    _Height := _Bottom - _Top

Return


Here is to say, that the hotkeys move the active window, but don't make sure, that the active window will "follow" a moving taskbar. They (the hotkeys) will however, after the taskbar is moved/resized, be able to position the active window correctly (in my example Win+Ctrl+Right (Left)).

@Dinguz: Does that still work for your setup? I understand from your last post that HotCorners does not interfere, and your original question (HOWTO activewindow TO one side) is answered adequately?

PS: I will see if I can trigger those functions with hitting the mouse into the upper left/right corner using a user-modified HotCorners script.
I think I finally understood now what was asked in the first place, right?

_________________
Wolf

Schön wär's, wenn's schön wär!


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], MSN [Bot] and 19 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group