topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 5:25 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Last post Author Topic: WinManagement Snap & AHKSnap !  (Read 40596 times)

Armando

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 2,727
    • View Profile
    • Donate to Member
WinManagement Snap & AHKSnap !
« on: January 07, 2008, 12:42 PM »
Ok, so here's a modified version of jgpaiva's WinManagement AHK script (my first try at a "real" AHK script).  :Thmbsup: :)

It doesn't need farr to work and is now a kind of FreeSnap clone... without the undo feature (sorry...) and the incremental resizing (I think that this can already be dealt with properly with Grid move anyways...)... BUT, of  course, with some other features (already existing in WinManagement) : 1-Maximize vertically or horizontally, 2-Toggle On Top/Not On Top, and 3-Maximize/Restore window


Here 'a description of the hotkeys/features (these are mere suggestions : to modify the hotkeys, just modify the script) :


Snap window's borders to edge of the screen :
--------------------------------------------------
WinKey + Up  : snap top window border to screen edge
WinKey + Down : snap bottom window border to screen edge
WinKey + Left : snap left window border to screen edge
WinKey + Right : snap right window border to screen edge


Move window to screen corners :
----------------------------------

WinKey + Home : move window to upper left corner
WinKey + End : move window to bottom left  corner
WinKey + PgUP : move window to upper right corner
WinKey + PgDn  : move window to bottom right corner


Maximize vertically or horizontally :
---------------------------------------

Ctrl + WinKey + Left or Right : Maximize horizontally
Ctrl + WinKey + Up or Down : Maximize vertically


Other common window management :
------------------------------------------

Ctrl + WinKey + PgUP : Maximize/Restore window
Ctrl + WinKey + PgDn : Minimize window
Ctrl + WinKey + Home : Toggle On Top/Not On Top  



Here' the compiled version + the AHK script. To run the uncompiled script, you need to have AHK installed (download it for free).

Edit : 2008 01 07 : new version to better deal with the taskbar.

Edit : 2012 03 20 : completely revamped script by Lanux. See end of thread.
« Last Edit: March 20, 2012, 09:02 AM by Armando »

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: WinManagement Snap!
« Reply #1 on: January 07, 2008, 12:53 PM »
That's pretty cool, armando!
Let's see if we can get ourselves another ahk coder for the family ;)

tranglos

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,081
    • View Profile
    • Donate to Member
Re: WinManagement Snap!
« Reply #2 on: January 07, 2008, 01:46 PM »

Maximize vertically or horizontally :
---------------------------------------
Ctrl + WinKey + Left or Right : Maximize horizontally
Ctrl + WinKey + Up or Down : Maximize vertically

Thank you, thank you, thank you! I was just going to post in search of these two behaviors. My wish has been granted before I even asked, how's that for greatness?

WinKey + Down : snap bottom window border to screen edge

One minor bug perhaps: the window snaps to physical bottom of the display, i.e. gets underneath the taskbar (if the taskbar is at bottom).

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: WinManagement Snap!
« Reply #3 on: January 07, 2008, 01:51 PM »
That's because armando is using (in the same manner as i was using in winmanagement) the A_screenheight/a_screenwidth variables, which don't take into account the height of the taskbar.

If you'd like to solve this, armando, see this page, specially:
SysGet, OutputVar, MonitorWorkArea,1

That allows you to get the values of the top,right,bottom and left of the screen on the following variables: OutputVarTop, OutputVarRight, OutputVarBottom and OutputVarLeft.

[edit] added explanation[/edit]
« Last Edit: January 07, 2008, 02:04 PM by jgpaiva »

tranglos

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,081
    • View Profile
    • Donate to Member
Re: WinManagement Snap!
« Reply #4 on: January 07, 2008, 01:58 PM »
I'll try that, thanks a lot!

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 11,959
    • View Profile
    • Donate to Member
Re: WinManagement Snap!
« Reply #5 on: January 07, 2008, 02:16 PM »
congrats Armando!

is that like gridmove
I mean is that actually a modified version of gridmove?

if so, do the gridmove keys/grids still work too?
Tom

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: WinManagement Snap!
« Reply #6 on: January 07, 2008, 02:18 PM »
None, tomos :)

It's a modified version of the script i used for this farr alias.

Armando

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 2,727
    • View Profile
    • Donate to Member
Re: WinManagement Snap!
« Reply #7 on: January 07, 2008, 05:12 PM »
Thanks everyone! I just came back.

That's because armando is using (in the same manner as i was using in winmanagement) the A_screenheight/a_screenwidth variables, which don't take into account the height of the taskbar.

Exactly  :-[


If you'd like to solve this, armando, see this page, specially:
SysGet, OutputVar, MonitorWorkArea,1

That allows you to get the values of the top,right,bottom and left of the screen on the following variables: OutputVarTop, OutputVarRight, OutputVarBottom and OutputVarLeft.

[edit] added explanation[/edit]

Thanks jgpaiva ! I shall take a look at that and try to understand... later tonight when I have 5 more minutes! :)

Of course, it would be easy to add many many more features (like scrolling up/down a window -- although that might be a bit tricky for me at that point)... Anybody can modify the script anyways, but if there are other suggestions, I can try...

Armando

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 2,727
    • View Profile
    • Donate to Member
Re: WinManagement Snap!
« Reply #8 on: January 07, 2008, 07:24 PM »
OK, I made the modifications. it should now work whether the taskbar is visible or not, and wherever it's positioned on the screen. Try it and tell me if it works as expected.  :)

(Update the files in my first post)

tranglos

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,081
    • View Profile
    • Donate to Member
Re: WinManagement Snap!
« Reply #9 on: January 08, 2008, 08:42 PM »
Works great now, thank you!

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: WinManagement Snap!
« Reply #10 on: January 08, 2008, 09:27 PM »
how did i miss this? great work, Armando.. :Thmbsup: going to d/l & try this..

Armando

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 2,727
    • View Profile
    • Donate to Member
Re: WinManagement Snap!
« Reply #11 on: January 08, 2008, 09:58 PM »
Thanks guys.
It's not much, really.  :-[
It's basically freesnap + WinManagement (by jgpaiva)... Without the "Undo" feature.
But it was fun to "rewrite", yesterday, to take the taskbar in consideration.  :)

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: WinManagement Snap!
« Reply #12 on: January 08, 2008, 10:12 PM »
But it was fun to "rewrite", yesterday, to take the taskbar in consideration.

that's the magic of DC - it makes coders out of users! :) hmm.. now that sounds like a tag-line..

Armando

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 2,727
    • View Profile
    • Donate to Member
Re: WinManagement Snap!
« Reply #13 on: January 08, 2008, 10:31 PM »
Ahah! Yes, it probably does (make, ahem, "coders" out of users).
I think that I always wanted to "code"...
I Hope I'll have more time to learn.
Maybe I'll do like superboyac and learn a bit of C/C++.  :)

Ampa

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 592
  • I am cute ;)
    • View Profile
    • MonkeyDash - 2 Player strategy boardgame
    • Donate to Member
Re: WinManagement Snap!
« Reply #14 on: January 09, 2008, 06:59 AM »
Congratulations on your first AHK util.

The funtionality seems very similar to another AHK script that I use... WindowPad. Not a critisism, just an observation!

How does your script differ? What other features (if any) do you think you might add?

Ampa

Armando

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 2,727
    • View Profile
    • Donate to Member
Re: WinManagement Snap!
« Reply #15 on: January 09, 2008, 07:05 PM »
Hi Ampa! Thanks for bringing this to my attention.  :) Looks like a fun script.
Actually, this was just a tiny little exercise for me... The script you're referring to is more elaborate and its features are a bit different since it supports multiple-monitor. WinManagement Snap! (based on jgpaiva's WinManagement and Blue Onion Software's FreeSnap) is mostly to quickly change windows size and shape; so it's main point is to resize a window in the direction you choose, up to the screen border. It also other things, like indicated in the first post of this thread.

Looking at the WindowPad's features, we see that it doesn't exactly do the same thing -- it's more "zone" oriented, like GridMove.

;   Move and resize windows with Win+Numpad.
;     Win+Numpad1 = Fill bottom-left quarter of screen
;     Win+Numpad2 = Fill bottom half of screen
;     etc.
;
;   Move windows across monitors. For example:
;     Win+Numpad4 places the window on the left half of the screen.
;     Win+Numpad4 again moves it to the monitor to the right.
;
;   Quick monitor switch:
;     Win+Numpad5 places the window in the center of the screen.
;     Win+Numpad5 again moves the window to the next monitor.
;     (This works by monitor number, not necessarily left to right.)
;
;   QUICKER Monitor Switch:
;     Win+NumpadDot switches to the next monitor (1->2->3->1 etc.)
;     Win+NumpadDiv moves ALL windows to monitor 2.
;     Win+NumpadMult moves ALL windows to monitor 1.
;
;   Other shortcuts:
;     Win+Numpad0 toggles maximize.
;     Insert (or some other key) can be used in place of "Win".
;
; Credits:
;   Concept based on HiRes Screen Splitter by JOnGliko.
;   Written from scratch by Lexikos to support multiple monitors.
;   NumpadDot key functionality suggested by bobbo.

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: WinManagement Snap!
« Reply #16 on: January 09, 2008, 07:19 PM »
Cool, WindowPad has some interesting features! :)

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: WinManagement Snap!
« Reply #17 on: January 09, 2008, 08:13 PM »
good find, Ampa but it does look a bit elaborate.. :)

Armando

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 2,727
    • View Profile
    • Donate to Member
Re: WinManagement Snap!
« Reply #18 on: January 09, 2008, 09:00 PM »
What other features (if any) do you think you might add?

I forgot to answer that question...
In terms of features, I didn't really think of any others for now, but if some have suggestions, who knows.  :)

Nxqd3051990

  • Participant
  • Joined in 2006
  • *
  • default avatar
  • Posts: 78
  • Train to become GTD Master
    • View Profile
    • Donate to Member
Re: WinManagement Snap!
« Reply #19 on: March 26, 2008, 06:19 AM »
Aha, cool program  :Thmbsup:
KEEP IT SIMPLE !
Hardware ASUS K8N |AMD 2800+@2,6 with WC| Ram Kingmax 512@235 2-4-4-11
Software   Firefox 2.0.0.5 | XYplorer | Foobar 0.9.4.2 | VLC | AutoHotkey | SciTe | Pidgin
Sites Y!Blog | Facebook | Tumblog | Last.fm

Armando

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 2,727
    • View Profile
    • Donate to Member
Re: WinManagement Snap!
« Reply #20 on: March 26, 2008, 09:06 PM »
Thanks!  :)
Really, it's nothing. I played with jgpaiva's script (that he made for a farr plugin) and added a few little things from Blue Onion Software's FreeSnap... If you look at the script, you'll probably also find that's not hard to modify to your liking.

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
AHKSnap!
« Reply #21 on: March 19, 2012, 08:35 PM »
NECRO THREAD ALERT

i had modified the original WinManagement Snap script to add/remove a few things, such as:
added
snap undo, center windows (win+numpad5) and incremental resizing (win+numpad plus/minus)

removed
resize vertically or horizontally,  max/min window, and toggle on top feature.

so with Armando's permission, here is the modified script (ahk+exe), feel free to modify it for your own purposes.

note: to add/remove resolutions for the incremental resizing feature, you may need to edit AhkSnap.ini.

[Size]
;variables here
size1= 320,240
size2= 640,480
size3= 800,600
size4= 1024,768
size5= 1152,864
size6= 1280,600
size7= 1280,720
size8= 1280,768
size9= 1280,800
size10= 1360,768
size11= 1440,900
-AhkSnap.ini


Armando

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 2,727
    • View Profile
    • Donate to Member
Re: WinManagement Snap!
« Reply #22 on: March 19, 2012, 10:13 PM »
 :Thmbsup:
Cool ! I like it. Much, much better and sophisticated. It's a completely new script.

Of course, as I told you, that was my first baby step into the scripting/programming world... Didn't know anything at the time. I still feel like I know nothing, but that's another story.  ;D

The exe works perfectly.

The AHK file gives me an error : "IniRead" requires at least 4 parameters. I quickly added "size9" as the last argument. Not sure that this is the best way though -- just did what seemed obvious without too much thinking. (The reason I'm trying the AHK file is that I usually append all the little scripts together in a bigger script... less processes to manage).

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: WinManagement Snap!
« Reply #23 on: March 19, 2012, 10:24 PM »
The AHK file gives me an error : "IniRead" requires at least 4 parameters. I quickly added "size9" as the last argument. Not sure that this is the best way though --

sorry about that, Armando. i forgot to mention that the newer script uses AutoHotkey_L (a custom build of AutoHotkey). AHK_L's IniRead command is slightly different, that's why you're getting that error. :)

You can learn more about AHK_L, here.

Armando

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 2,727
    • View Profile
    • Donate to Member
Re: WinManagement Snap!
« Reply #24 on: March 20, 2012, 08:59 AM »
Interesting. I just installed it but am having problems with various scripts. Will revert to the plain AHK for now and will check later.
(Of course, the compiled version of AHKSnap isn't affected at all -- just saying this for others reading following the thread !)
Thanks Lanux.


(EDIT : BTW Lanux, if you want to create a new thread -- or split this one -- for AHKSnap, you can... It's different enough to justify it. It's really up to you.  :) )
« Last Edit: March 20, 2012, 09:05 AM by Armando »