microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
109.66k stars 6.46k forks source link

[FancyZones] Exclude app by window title / exe #1614

Open amnonig opened 4 years ago

amnonig commented 4 years ago

Summary of the new feature/enhancement

The feature of "Move newly created windows to their last known zone" has a flaw - it resizes dialog boxes that can (but under normal circumstances shouldn't) be resized, such as the file dialog or Find and Replace. While I like Excel windows to open in their prior place, I don't want the Find/Replace or the file dialogs box to span a huge space. The proposal is to allow exclusion by window title (maybe also by dialog type for standard dialog boxes like the file dialog). To do that (by title), the user would add the window title (e.g. "Find and Replace") to exclude windows with that title from being resized automatically.

Proposed technical implementation details (optional)

JWoolley-FL-USA commented 4 years ago

Summary of the new feature/enhancement

Re. FancyZones setting Exclude applications from snapping to zones - Apparently the text entered here refers to all or part of an application's filename. It would also be useful to identify exclusions based on all or part of a window's title (or caption).

For example, assume Move newly created windows to their last known zone is set ON. If Excel is snapped to a FancyZone, pressing Alt+F11 opens the "Microsoft Visual Basic for Applications" Editor (VBE) snapped to the same FancyZone. If I reshape the VBE window it will remember its new shape the next time I open VBE, which is appropriate. The next time I open Excel it will snap to the FancyZone, which is appropriate; then if I press Alt+F11, VBE will open with its previous shape, which is appropriate. However, if I hold the Shift key while dragging Excel's window and snap it to a FancyZone (again), the next time VBE opens it will snap to that FancyZone, not its previous shape.

Outlook's New Email window provides a similar example. I believe this applies frequently to certain windows opened by an application, but not to all (fortunately).

Proposed implementation

There should be a way to exclude certain windows opened by an application from snapping to its FancyZone. It looks like the function IsInterestingWindow(HWND window) attempts to do this, but that is not sufficient. The FancyZones setting Exclude applications from snapping to zones should also permit exclusions based on all or part of a window's title (or caption).

enricogior commented 3 years ago

Related to https://github.com/microsoft/PowerToys/issues/1802

FaceCrap commented 4 months ago

I would like to upvote this one, but I would like to have the option to exclude by caption title as an additional option, not totally replacing by executable name.

Description of the new feature / enhancement Excluding child windows from snapping by Caption Title and not just only executable name

Scenario when this would be used? Some programs use child/popup windows which do not get excluded even when the option to snap child windows is not ticked.

One example is WinMerge, where the "Browse for folder" popup gets enlarged to the size of the zone WinMerge itself is using, but the popup itself isn't positioned at the same location but at the last popup position, this results in the Ok/Cancel buttons being totally outside the monitor display.