dannyben / gridy Goto Github PK
View Code? Open in Web Editor NEWSnap Windows to Grid
Home Page: http://sector-seven.com/software/gridy
License: MIT License
Snap Windows to Grid
Home Page: http://sector-seven.com/software/gridy
License: MIT License
====================================================================== Gridy 0.72 Snap Windows to Grid by Danny Ben Shitrit (Sector-Seven) 2006-2024 [email protected] https://sector-seven.com Download Binary: https://sector-seven.com/software/gridy ====================================================================== Introduction ----------------------------- Gridy adds an invisible grid to Windows, so that any window you move or resize is snapped to it. Snapping is enabled with mouse drag or keyboard arrow keys. Gridy also lets you store and restore a window's size and position in up to 12 slots. This is useful for quickly arranging your windows in a convenient way. In addition, you can apply these changes to any window or dialog: - Make any window semi-transparent - Hide the window's Alt-Tab icon - Set any window to be Always on Top - Resize any window to a predefined size of your choice - Minimize all windows but the active one Getting Started ----------------------------- After starting Gridy, right click its icon in the system tray to access some configuration options. You may also double click the system tray to see the Help screen with all of the available actions. For example, while a restored window (not maximized) is in focus, press and hold the Win key and press the arrow keys to move the window in fixed intervals. The same snapping effect can also be achieved by simply moving or resizing the window. Technical Notes ----------------------------- Gridy is built as a single executable + a configuration file. The configuration file is a simple INI file that can be edited either manually or by using the system tray menu. Gridy does not write anything to the registry and is completely portable. Revision History ----------------------------- 2024 06 05 - 0.72 Changed: Maximized windows can now be restored to one of the preset sizes 2024 05 26 - 0.71 Changed: Maximized windows can now be resized/moved by keyboard (they will be restored first) 2015 11 22 - 0.70 Fixed : Help dialog reported one incorrect keyboard shortcut (Thanks Garrick) Changed: Help dialog will now consider all the custom keyboard shortcuts 2015 03 03 - 0.61 Added : Ability to resize non resizable windows 2015 01 16 - 0.60 Added : Ability to use F keys for storing windows positions Changed: Modifier for windows preset from Win to Win+Alt Changed: Ability to customize windows preset modifier keys Changed: License from Creative Commons Attribution 3.0 Unported License to MIT. 2011 10 11 - 0.50 Changed: Source released as creative commons, time to have a round version number... 2011 06 30 - 0.48 Added : Support for edge behavior on multiple monitors. Windows can now be confined to a specific monitor. When in Block or Shrink mode, use the mouse to drag windows from one monitor to the other. (thanks Daniel) Changed: Monitor count is now updating whenever a new monitor is plugged in or out. 2011 02 11 - 0.47 Added : Edge Behavior option. Lets you configure how Gridy behaves when a window is moved or resized past the edges of the screen. Block: Will snap the window back into view Shrink: Will shrink the window so its completely in view Ignore: Will let you move or resize window past the screen (previous behavior). This function is taskbar aware and will not be available for systems with multiple monitors. 2011 02 09 - 0.46 Added : Ability to configure is Numpad or normal numbers are used for the preset positions (thanks Sycdan) 2010 12 03 - 0.45 Added : Ability to configure hotkeys in the INI file (thanks Nick). 2010 01 22 - 0.44 Added : Store/Restore up to 9 window sizes and positions. Added : Ability to edit the Grid Size menu (see INI file -> Grid Sizes) Changed: Grid size for horizontal and vertical axes now separated, to allow higher flexibility and better compatibility with widescreen monitors. 2009 08 05 - 0.42 Fixed : When window were resized using the statusbar corner grabber, windows were usually not snapped. 2009 07 31 - 0.41 Added : Setting in INI file to disable the Win+ESC hotkey (which normally exits Gridy). Updated: Young installer from 0.34 to 0.37 2009 07 23 - 0.40 Removed: All code related to window shadowing. Decided to release to hte public without this feature. Added : Welcome tip. Changed: Some additional minor code changes and cleanup. 2008 12 25 - 0.37 Added : Win+F10 adds transparency. Added : Sub menu to configure transparency level. Removed: LiveUpdate 2007 02 02 - 0.36 Fixed : Win+Shift+Home did not store new values in the INI file. 2007 01 31 - 0.35 Removed: startup tray tip Added : Win+Shift+Home shortcut to store the window height/width, to later be restored by Win+Home. Updated: installer 2006 11 12 - 0.34 Fixed : LiveUpdate now knows when there is no internet connection 2006 09 18 - 0.33 Changed: icons 2006 09 17 - 0.32 Added : Win+PgDn hotkey - minimize all except active window 2006 09 10 - 0.31 Added : LiveUpdate on startup and in menu 2006 09 04 - 0.30 Added : Win+F12 hotkey for always on top (toggle) Added : Win+F11 hotkey for alt tab icon (toggle) 2006 09 01 - 0.26 Changed: shipped with new installer Chamged: now no longer including ini and ico files inside the exe 2006 08 31 - 0.25 Added - Win+Home key now resizes the window to a fixed size (configurable) Fixed - help dialog is now created only once Added - Esc will now exit the help dialog 2006 08 12 - 0.24 Fixed : keyboard snapping did not ignore maximized windows 2006 08 11 - 0.23 Added : reload option to tray menu Added : new hotkey: Win+Arrow Keys to move windows and snap to grid Added : new hotkey: Shift+Win+Arrow Keys to resize windows and snap to grid Changed: new Help dialog 2006 08 11 - 0.22 Added : menu items to change some INI settings 2006 08 09 - 0.21 Fixed : when starting to move another window, shadow first showed itself for a quick second, with the size of the previously snapped window. Fixed by first placing the shadow at the right place and only then "untransparenting" it 2006 08 09 - 0.20 Changed: improved performance when shadow is enabled. now when the frame is created, it is never "hidden", instead, it is being resized to a 1x1 pixel on the top left of the screen, and then set to full transparency. in order to accomplish this, the alt-tab icon of the frame was removed using ExStyle 0x80. in addition, some seemingly ineffective lines were removed from the ShowFrame and HideFrame routines. Another, more minor change was done in the main WatchCursor timer. Fixed : shadowtype Shadow is now also transparent. This was fixed by accident, probably to a better use of the transparency settings and the fact that we do not hide and show the window all the time 2006 08 08 - 0.19 Fixed : version 0.18 broke the Solid frametype action - solid shadow got stuck. This was fixed by changing the way by which we check if we have a menu, by simply checking if the window we attempt to "shadow" still exists. Menus, do not exist after they are clicked. Changed: startup and exit tooltips are now shorter Added : first attempt to reduce timer performance - added SetBatchLines 2006 08 08 - 0.18 Fixed : shadow frame and tooltip were created when clicking menus. fixed by checking if the window id has changed since we first clicked the mouse. 2006 08 07 - 0.17 Fixed : shadow frame now does not have a task bar icon. fixed with +OWNER attribute Added : abother shadow type - Shadow. This style currently does not support transparency for some reason. Need to check if this is by design, or by bug. 2006 08 07 - 0.16 Added : shadow border when moving/resizing windows. configurable through INI. 2006 08 06 - 0.15 Fixed : non resizable windows used to be moved to grid when certain controls were selected. this was fixed by capturing the control under the mouse upon click, and if there is any control, we do not move. Added : exit traytip 2006 08 06 - 0.14 Fixed : changed the execution order of the main routine. It should fix the bugs where non resizable windows are resized, and the bug where windows used to move with only a mouse-over. 2006 08 06 - 0.13 Fixed : when a window first loaded, it used to snap even without the user moving it. had a missing Return in startup routine. Fixed : now ignoring maximized windows, or windows that are just being maximized. 2006 08 05 - 0.12 Added : new key in INI - DisableKey. pressing this key when dragging will move the window freely, without any snapping. 2006 08 05 - 0.11 Fixed : (hopefully) now ignoring non-resizable windows Added : key in INI file to set the non-resizable window handling 2006 08 05 - 0.10 First version =============================================================================
Hey there,
This is wonderful, and just enough complexity without being too much. I have changed the .ini file to use WIN+NUM1 for example to recall a preset, I feel it's less awkward than WIN+ALT. I would suggest some, hotkey or visual overlay that would illustrate the preset positions. (Probably more trouble than its worth)
This is the main suggestion:
Allow an assignable hotkey to cycle though favourites. So there might be a hotkey say WIN+Z and that would cycle though presets 1,3,4,5 on each press of the same hotkey.
The favourites could be defined in the .ini.
favouritePresets=1,3,4,5
favouriteKey =#z
Anyway thanks a lot for this software, its super. If you send me your email I'll send you a coffee to say thanks.
I'm not good at explaining things, so I will try to show.
If you implement this feature, [Positions] part of the Gridy.ini could look like this (silly example):
[Positions]
Position1 =0,330,840,690
Position2 =0,330,1680,690
Position3 =840,330,840,690
Position4 =0,0,840,1020
Position5 =450,225,720,600
Position5 =405,165,900,720
Position5 =300,75,1155,915
Position6 =840,0,840,1020
Position7 =0,0,840,330
Position8 =0,0,1680,330
Position9 =840,0,840,330
Position10=128,64,512,512
Position11=544,64,512,512
Position12=768,64,512,512
Do you notice multiple Position5 entries? This means when you press Win+Numpad5 you will get:
Position5 =450,225,720,600
But if you press Numpad5 the second time you will get:
Position5 =405,165,900,720
And the third time you will get:
Position5 =300,75,1155,915
This is something like in Explorer, if you click once you select a file, but if you click twice you open a file.
Since we are talking about keyboard keys (no mouse "clicking like crazy" limitations) we can have as many positions as we want in a single shortcut (in my example, only 3 for Win+Numpad5).
This will not affect regular users, only those who open Gridy.ini and add their own multiple positions.
Gridy could show position of a active window in a tray icon tooltip. Currently it only shows %NameString% + %VersionString%.
So what do you think? Good idea or too much work for something which will only advanced users use?
Hey there it would be great if Gridy worked on maximized windows.
I find I am hitting a hotkey all the time, realising that window is maximized, hitting another to un-maximise, and hitting the Gridy hotkey again.
Thanks!
; Check if window is maximized, at the last possible moment in order
; to also catch windows that are in the process of being maximized
WinGet MinMax, MinMax, ahk_id %MWinID%
; Finally, all filters are ok, now check that the window is not
; maximized, and snap it.
If( MinMax = 0 ) {
HandleEdge( NewWX, NewWY, NewWWidth, NewWHeight )
If( !WindowIsResizable )
WinMove ahk_id %MWinID%,, NewWX, NewWY
Else
WinMove ahk_id %MWinID%,, NewWX, NewWY, NewWWidth, NewWHeight
}
I got Gridy.ahk
and Gridy.ini
.
Gridy.ini
?Hello,
I'm making a request for option to set the interval for how fast the window move and resize operations operate. Now moving by holding the buttons down is a bit slow and you can do it faster by pressing the keys repeatedly. It would be in my opinion better if you could do fast moving whit holding buttons down and smaller, slower adjustments by repeatedly pressing the buttons.
@DannyBen I seem to be having a problem with Gridy on Windows 10 when it comes to calculating window size / position and snapping windows to a grid. See attached image, there is a margin between the windows when aligned with Gridy. I also left this as a comment on the Gridy product page.
I really need Gridy to stop ignoring maximized windows, it's just my workflow. In the past I've tried removing code, but always end up with a bug or two.
So please could you tell me what code should I comment out/delete, so Gridy will work on maximized windows, too?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.