How to prevent windows from being resized?

4

1

Adobe Audition is really stupid in that when you change the size of the window, and then change it back to the original size, all the frame positions are lost and you have to tediously reposition them by hand.

I'd like to make it completely impossible to ever resize the window, just keep it maximized at all times. If I accidentally click "Restore" or drag the title bar, it should either ignore it, or move around the screen while staying the same size. Is there any way to do this?

endolith

Posted 2012-08-29T18:05:59.480

Reputation: 6 626

Answers

4

One can disable the resize of a window by changing its border style to one that does not support resizing.

Here are two products that can edit the style of a window :

Window Detective
Winspector

I found Window Detective to be much more reactive than Winspector, although working with both is very similar. Here is how I rendered notepad to be unresizable.

After launching Window Detective and notepad, click the "Pick window" button of Window Detective and bring it over the notepad window. The notepad window is highlighted, but ensure that you chose the entire notepad window rather than only a sub-window such as the edit-text control.

Click to choose the notepad window. Window Detective will then display it in its Window list. Right-click on it and choose "Edit Window Styles" :

image1

The following window is displayed :

image2

Uncheck the style called "WS_THICKFRAME" and click OK.
This is it - the border of notepad can no longer be resized.

Note : If Window Detective slows-down the display, close its Messages panel.

harrymc

Posted 2012-08-29T18:05:59.480

Reputation: 306 093

1the main problem is accidentally clicking and dragging on the title bar, accidentally clicking the restore button, etc. does it prevent those? the window doesn't even have resize handles in maximized mode – endolith – 2012-10-15T03:18:47.427

One can get rid of the min/max buttons by also unchecking WS_MINIMIZEBOX/WS_MAXIMIZEBOX. That should also get rid of the restore button, but render the window's size unchangeable. So better set the window to the right size (or maximized) before changing its style. – harrymc – 2012-10-15T07:00:38.140

That almost works, but I can still drag the title bar which is the same as "Restore" in Windows 7. WS_BORDER almost works by removing the title bar completely, but makes it overlap the taskbar when you restore from Desktop mode. Also this would have to be done each time I run it? – endolith – 2012-10-15T14:00:14.767

1

(1) For the title bar, maybe this link might help. (2) Be careful with turning off too many UI elements, but there's nothing wrong with trying it out. (3) Yes, this has to be done repetitively, but maybe you can automate it using a macro recorder such as AutoHotkey.

– harrymc – 2012-10-15T14:29:00.887

3

My first idea was a partial solution - saving your workspace (after you finished positioning everything), and when it gets messed up, using the Reset workspace option.

You could even assign a Keyboard Shortcut to it, and then fixing the position is just a key-press away.

UPDATE: After some more digging around, I found something that does exactly what you requested.

WinSize2

After launching the program, select the Adobe Audition, and then right-click the tray icon of WinSize, and use Last Window: Add/Overwrite Entry, then double click the tray icon, pick from the dropdown Adobe Audition, and mark the checkbox besides always in the Width/Height frame.

Save these settings by pressing Change on the right, and OK in the bottom.

Michael

Posted 2012-08-29T18:05:59.480

Reputation: 423

Actually, I somehow got this to work. I clicked Audition and then clicked "Last window: Add/Overwrite entry". I don't know what that means, or how this program works, but when I drag the title bar, push Restore, or otherwise change the size of the window, it moves the window but won't change its size. yay – endolith – 2012-10-15T14:18:46.663

Actually wait no, that doesn't work, and I don't understand this program. It worked exactly as I wanted it to for a few minutes, at least. – endolith – 2012-10-15T14:42:19.083

This somewhat works, but the window is still being allowed to resize by a few pixels at a time? So the panes slowly shift out of position if the window is moved around. Better than nothing, though. – endolith – 2012-10-19T03:42:25.227

This also has the bizarre side effect of maximizing the "current file not saved" window to fill up the entire screen :( – endolith – 2012-10-24T17:37:12.643

1@endolith, yea I also encountered this, try checking the "use Class name" check box so It will rely only on the title (which differs between windows), instead of the same class name. – Michael – 2012-10-24T20:18:14.053

that was already checked. I unchecked it and it seems to work – endolith – 2012-10-24T21:37:31.693

0

WindowsLayoutSnapshot is a free tool that captures positions of all windows and allows to restore them. Read the project README and check it out, it works great for Windows 7.

Originally created by https://github.com/adamsmith and forked many times on github. You may try different forks, this one is mine and I used it all the time on Windows 7.

Alec Istomin

Posted 2012-08-29T18:05:59.480

Reputation: 499