Code Monkey home page Code Monkey logo

windowresizer's Introduction

WindowResizer

WindowResizer GitHub all releases GitHub release (latest SemVer)

WindowResizer is a simple tool that gives you a way to use hotkeys to quickly save and restore different window positions and sizes.

Download

  • Github Release

    https://github.com/caoyue/WindowResizer/releases/latest

    require:

    • Windows 7+ (x64)
    • .NET Framework 4.7.2+
  • Microsoft Store

    Get WindowResizer from Microsoft Store

    The Windows Store version has the same features as the GitHub release version.
    You can support development by purchasing it on the Windows Store.

App

hotkeys

Change hotkeys in setting window.

  • save window position

    default hotkey: ctrl+alt+s

  • save all opened window position

  • restore window position

    default hotkey: ctrl+alt+r

    demo
  • restore all opened window position

    demo

usage

  • how to add an config entry

    Focus on the window (eg. Chrome), then press the save window hotkey (ctrl+alt+sby default), an entry will be added to the configuration file.

  • How does the window matching work?

    The process name is matched first. The title is not required, by default use a wildcard * to match all the titles for a process name. And if you specify the title, it will be matched first.

  • Option: Resize by title Uncheck: Resize based on process Checked: Resize based on Process and title

  • Auto resize: restore window position automatically

    check the checkbox on Auto column.

    demo
  • Option: Auto resize delay This option is used with the Auto Resize feature. When Auto Resize based on process titles, some titles are not immediately determined, such as Chrome web pages. If this option is checked, you can set a delay(in millisecond) for the Chrome process, so when a new Chrome window is created, there will be a delay before resize takes effect.

  • portable mode

    • download portable package
    • put WindowResizer.config.json in the same folder as the program file WindowResizer.exe

CLI

run WindowResizer.CLI.exe resize -h

The CLI can run standalone without WindowResizer App running.

 __        __  _               _                      ____                 _
 \ \      / / (_)  _ __     __| |   ___   __      __ |  _ \    ___   ___  (_)  ____   ___   _ __
  \ \ /\ / /  | | | '_ \   / _` |  / _ \  \ \ /\ / / | |_) |  / _ \ / __| | | |_  /  / _ \ | '__|
   \ V  V /   | | | | | | | (_| | | (_) |  \ V  V /  |  _ <  |  __/ \__ \ | |  / /  |  __/ | |
    \_/\_/    |_| |_| |_|  \__,_|  \___/    \_/\_/   |_| \_\  \___| |___/ |_| /___|  \___| |_|


Usage:
  WindowResizer.CLI resize [options]

Options:
  -c, --config <config>    Config file path, use current config file if omitted.
  -P, --profile <profile>  Profile name, use current profile if omitted.
  -p, --process <process>  Process name, use foreground process if omitted.
  -t, --title <title>      Process title, all windows of the process will be resized if not specified.
  -v, --verbose            Show more details.
  -?, -h, --help           Show help and usage information

e.g.,

# Resize all
WindowResizer.CLI.exe resize

# Specify config file and profile
WindowResizer.CLI.exe resize -c "X:\WindowResizer.config.json" -P "my-profile"

# Show verbose
WindowResizer.CLI.exe resize -v

# Filter windows by process
WindowResizer.CLI.exe resize -p "notepad.exe"

# Filter windows by title regex
WindowResizer.CLI.exe resize -t ".*.txt" 

# Combine all options
WindowResizer.CLI.exe resize -c "X:\WindowResizer.config.json" -P "my-profile" -p "notepad.exe" -t ".*.txt" -v

Build

  • .NET Framework 4.7.2
  • Visual Studio 2019/2022 or JetBrains Rider
  • Projects
    • WindowResizer: the GUI app
    • WindowResizer.CLI: the CLI app

Stats

Alt

windowresizer's People

Contributors

caoyue avatar wilsonmfg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

windowresizer's Issues

Resize Chrome New Windows

Hello,

Your app is Amazing !!! Thanks a lot !!! :)

I use with "Chrome" and "Title", it work if I use "Hotkeys" but not in AUTO when I do "Open link in new windows".

How do that in "Auto" when I open an link in "New Windows" ?

Again thanks a lot... ! :)

Release 1.1.0

  • Win key support #28
  • Hotkey to save all windows #23
  • Show tips when elevated privileges required #27
  • Add an option to disable checking updates at startup
  • Minor bug fixes and performance improvements
  • UI improvements

Suggestion : adding profiles

Hi,
first of all, amazing application. Thanks a lot.
Would it be possible to add profiles ?
I'm using the application on my laptop and I have a different screen setup between the office and home.
Maybe two different "save all" & "restore all" shortcuts ?
Or a right clic on the tray icon to select "home" or "office" (or profile1/profile2).

Thanks :)

Error when saving and removing entries with "Resize by Title" deactivated

Hi,

there seems to be a problem with saving and removing of process entries when Resize by Title is deactivated.

Deactivate this option and a newly created process entry will not be shown, only after a restart.

If there are process entries and the option is deactivated and an entry should be removed, an error message appears ("An error occurred, check the log file").
In the log, the following is shown:

[24.01.2024 11:35:07]Error: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at System.Collections.Generic.List`1.get_Item(Int32 index)
at WindowResizer.SettingForm.ProcessesGrid_CellFormatting(Object sender, DataGridViewCellFormattingEventArgs e)
at System.Windows.Forms.DataGridView.OnCellFormatting(DataGridViewCellFormattingEventArgs e)
at System.Windows.Forms.DataGridView.OnCellFormatting(Int32 columnIndex, Int32 rowIndex, Object val, Type formattedValueType, DataGridViewCellStyle cellStyle)
at System.Windows.Forms.DataGridViewCell.GetFormattedValue(Object value, Int32 rowIndex, DataGridViewCellStyle& cellStyle, TypeConverter valueTypeConverter, TypeConverter formattedValueTypeConverter, DataGridViewDataErrorContexts context)
at System.Windows.Forms.DataGridViewTextBoxCell.GetPreferredSize(Graphics graphics, DataGridViewCellStyle cellStyle, Int32 rowIndex, Size constraintSize)
at System.Windows.Forms.DataGridViewCell.GetPreferredWidth(Int32 rowIndex, Int32 height)
at System.Windows.Forms.DataGridViewCell.OnCellDataAreaMouseEnterInternal(Int32 rowIndex)
at System.Windows.Forms.DataGridViewCell.OnMouseMoveInternal(DataGridViewCellMouseEventArgs e)
at System.Windows.Forms.DataGridView.OnCellMouseMove(DataGridViewCellMouseEventArgs e)
at System.Windows.Forms.DataGridView.UpdateMouseEnteredCell(HitTestInfo hti, MouseEventArgs e)
at System.Windows.Forms.DataGridView.OnMouseMove(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseMove(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

After the restart, the removed entry is no longer present.

Exit doesn't always stop the program

Sometimes Exit leaves the exe running.

This seems to fix it:

private void OnExit(object sender, EventArgs e)
        {
            _settingForm?.Close();
            ConfigLoader.Save();
            _trayIcon.Dispose();
            _hook.Dispose();
            Environment.Exit(0);
        }

[Bug] Wrong window size when the task bar is on top

Some details:
3440x1440, task bar is on top, small icons are enabled.

How to reproduce:

  1. open some windows
  2. press Alt + Ctrl + S to save all
  3. change the position of any window (or you can just skip this step)
  4. press Alt + Ctrl + R to restore all

In my case 1/3 of the screen is window 1 and 2/3 of the screen is window 2.
After step 2 it looks like this:
image

And after step 4 it looks like this:
image

There is an extra space below the task bar, but it doesn't suppose to be here I believe.

error: when i click download release

it says: {"message":"Artifact not found or access denied."}

PS: ive build it. And its worked one time(not every time. il fix it). thank u very mach !!! i will use it.

Portable Mode broken?

I can't seem to get Portable Mode to work.

When I enable the check box, if I exit WindowResizer & relaunch it, the option is unchecked again.

If I enable the option & try to Export the config I get the error: "An error occurred, check the log file for more details."

Bug, or am I doing it wrong?

Thanks

Suggestion: menu for Save all / Restore all

Helllo,
First thanks for this very practical tool!
In the Status, WindowResizer has a menu with the profiles, settings, exit. It would be nice to have there also the "restore all" (which I mostly use) and "save all" functionalities.
By the way, are there functional limitations on the "portable" version?

Chrome windows not auto-positioning

Hello! Thanks for this very useful tool!
Everything works perfectly for me, except for Chrome windows, which do not automatically get positioned.
They do when I press the Restore hotkey though, it's only the auto-position that is ignored, and only with Chrome windows.

Maybe this happens because Chrome windows take a while to be titled (until the website loads on that window)? If so, maybe having the option to specify in some cases a small delay before trying to auto-position would help?

Thanks!

Does anyone see constant CPU usage until the process is restarted?

I'm on the current version, and I've seen it happen with it, but this is not a new problem. When it happens, the process (on my system, an older Core i5) takes around 15% CPU permanently (well, until you close the app and restart it). Perhaps that translates to one core, I'm not sure.

And then all is well until some random time later, usually days, when it happens again. I haven't figured out what triggers this, though I do know that it's not after any use of it, since I use it frequently (as in hotkey use).

Win11

Option to disable creation of second entry with title on save

Personally I never use windows title matching (at least so far) and delete it every time when save new window config (or edit existing one). It would be nice to have an option to not create it - maybe even better with some kind of combo with 3 options "save both, only process for all windows, only process with matching window title", for users that do opposite way ;).

[Feature Request] Add an option to include minimized windows when restoring all windows

I noticed an issue.

How to reproduce :
1- Save your windows setup
2- Move a window and reduce it
3- Restore the windows position with the hotkey
4- All the windows go back to their original position, except the one that is reduced.

You have to un-reduce it and then press the hotkey again to restore it to the desired position.

It would be great if pressing the hotkey would un-reduce and restore the window position directly :)

Thanks

how to open window WindowResizer in two user

i have two user in one and Window Resizer not allow to open in two pc it once i need to close in second pc to open in the first PC etc..
what i can to do with that i want open with to pc togheter

Not picking up windows

I'm having trouble getting WindowResizer to see most of the windows. It's basically just picking up its own Setting window. It's not picking up eg. Chrome, Notepad++, Windows Explorer or WinRAR. Is there a way to manually add a window other than by editing the JSON file? I tried editing the JSON file and some windows (eg. Notepad++) started to move when pressing Ctrl+Alt+R, so WindowResizer is sensing them.

How does the window matching work? Is the process name always required? Is it matched first?

Note: I am still using Windows 7 and it may be part of the issue, so I'm not sure how much time you want to invest in fixing this.

Optional notification after window settings saved

I use rather complicated shortcut (alt+ctrl+sfit+win+s) to save window configuration (in order to not save/overwrite accidentally). It's so complicated, that I'm not always sure, that settings was saved :) Maybe it'll be nice feature, if after such save, (optional?) notification will be shown - even better, with click action that displays settings window (in order to further tweak just saved config).

The position of the window moved to the secondary display is different from the setting.

  • Windows 11 Home 22H2
  • WindowsResizer.CLI.exe 1.3.3

Steps to reproduce

  1. Set primary display scaling to 150%.
  2. Set secondary display scaling to 100%.
  3. Configure that a window to move to a secondary display.
  4. Exec WindowReiszer.CLI.exe resize.

Expected Behavior

  • Window moves to the same position as when resized with HotKey.

Actual Behavior

  • Window moves to a different position than when resized with HotKey.

Streamlabs Chatbot - Version: 1.0.2.71

New user here. Loving the software, thank you! I've got a problem with just one of the applications I'm trying to save the position of. It's Streamlabs Chatbot. Seems to be working great with all the other software I'm using. Thanks again!

Title bar matching

I noticed a function in there for getting titles, have you worked on that at all, and if not, are you interested in a pull that would add it, and a UI to manage some basic wildcard management?

Unreadable icon on dark taskbar

When displaying on dark taskbar (default win10 settings), default icon is quite unreadable - is there any way to change it? If not, I'll appreciate if you consider add option to change it.

obraz

Window size differs from process value differences

Hi,
I want to use WindowsResizer to resize a window to a specific size because I need to take screenshots with that size. So I edited the values for Top, Left, Right, Bottom so that the differences (Bottom - Top) and Right - Left) match the desired size.
However, there is always a difference of 14 for Bottom-Top and 7 for Right-Left. Maybe these are fixed values due to the additional width of the window frame or something like that. Or is it a bug? Still, it would be nice to be able to just enter the real values without any calculations.
Possibly directly as width and height value and not as differences?

(Windows 10, WindowsResizer 1.3.4, three monitors)

need help

How to install this app I need tutorial

Apply also to taskbar

Discussed in #58

Originally posted by ebrouen May 6, 2023
I started to use WindowResizer a short time ago and I do appreciate it a lot.
A very nice improvement would be to be able to 'resize' (in fact better said 'reorder') the taskbars.

If there is 2 or more monitor, the manual process involves

  • unlocking all the taskbars,
  • moving the primary taskbar (where the systray is reachable)
  • and again lock all the taskbars.

This process is necessary if you change from a multi-monitor configuration to a single monitor configuration, like taking your laptop with you, and back.
Of course, it's not a very big job, but resizing a window is not a big job and still we appreciate WindowResizer...

Update?

Every time I open Window Resizer it says there is an update and when I click ok to download update I get an error. If that's not weird enough on its own I'm running v1.3.0 which from what I see here is the latest version. Any help would be appreciated.

[Feature Request] Restore taskbar order

When restored all window positions, taskbar seems like not restoring before order. Could you add a functionality to save taskbar order as well as windows positions?

I'm using Windows 10 22H2 with classic taskbar look.

config migrations and portable mode

#8 (comment)

  1. store config in the root of profile folder

  2. portable mode option
    To put it simply, firstly check "WindowResizer.config.json" in app folder,
    if exists, use it (Portable Mode);
    if not, check it in profile folder;
    both no, create it in app folder.

    and add a new option to move between two place;
    hope this solve the problem.

Option to only move window on restore

Some windows, like video players, change their sizes when video is open, etc.
Then on restore opened video gonna be resized.
Add option to move without resize.

[Feature Request] Switch profile on screen DPI/scale change

My main use of this nice tool is to ease pain of messing with windows on screen DPI changes (which happen on switching from external screen to notebook one, with 125% in my case). Most programs I use cannot properly restore it's position/size in this situation. But I have to manually switch profile after such change before restoring desired window position/size. It would be great if we can bind profile to given DPI/scale (not sure it they're the same from API perspective) and app can switch it automatically. In case of multiple screens with different scales I'd use primary screen value.

Compatibility CLI and WindowResize main application. Portable version

Hi,

Thank you for your very usefull application.

I've faced this problem :
I wanted to have both portable applications, main and CLI, in the same unique directory. Both versions are 1.3.4.0.
First I have the main application copied ("dezipped") in one directory. And I dezipped the CLI in that directory, all files except the already existing files (like "System.Memory.dll" and some others which are necessary in both main and CLI applications).

Main application works well. CLI doesn't. Problem with versions of some routines...
With CLI dezipped in its own directory, no problem.

Could be nice if the main (portable) application and the CLI could be in the same directory, avoiding redondant dll.

Regards.
Regis

Window not detected

Hi,

Somehow it seems like the sensor window of HWinfo64 is not detected. When I open the main program, it is indeeed detected, but when I try to do the same to the sensor panel (which is the one I would like to resize automatically) , it just doesnt get detected at all.

Not sure if I`m missing something or if it is just not compatible..

A way to hold things to one entry per process?

Can the program be configured to allow only one entry per process, or would that undermine some other functionality?

Inevitably I see multiples stacking up for things like Windows Explorer, a video player, browsers, etc.. This happens when I use Ctrl-Alt-S again for a new/better position. I'd rather it replace the previous one, but perhaps because the Title bar is different, it simply creates a new entry. This creates a degree of unpredictability for those who don't really care or think about titles, especially since "If you specify the title, it will be matched first," Maybe the title is the functionality that people would miss if multiples didn't accumulate, I'm not sure.

But for those who don't intentionally have, say, five identical processes with five different Titles all saving to different places, an overwrite option might be nice.

Just an idea, since I didn't already see it. Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.