ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE. Software > Coding Snacks

Maximize Windows "partially" [finished]

<< < (4/5) > >>

Basically to "maximize" to a certain size that will leave a portion of the desktop uncovered by the maximized app the hotkey just has to call a WinMove function on the active window(should be active since you just clicked on it or you might have to left click to make sure it's active, then click.  My ToggleTopmost takes that approach.  You Control-Right click on the active window and it toggles the "topmost" window attribute... so it's very easy to do.)

Once it's working then you might add a means of changing the window position and size via either .ini file or by the Tray Icon.  Either way is fairly straight-forward.

Here's a snippet where I get the active window, toggle the Topmost attribute, then I get the attribute and test for Topmost.  Then MsgBox tells the user the current state.. otherwise there'd be no feedback if the toggle succeeded(other than dragging another window in front or whatever.)

--- ---^RButton::
WinGet, ExStyle,ExStyle,%title%
if (ExStyle & 0x8)
  MsgBox,4096,Topmost Toggle, Topmost for window  %title% Enabled,2
  MsgBox,4096,Topmost Toggle, Topmost for window  %title% Disabled,2

In this case WinMove should be the primary function instead.

I use Autohotkey for resizing windows all the time. I have several different hotkeys that will resize to different sizes and positions depending on the window I am moving / resizing.

For example:

--- ---#1::
WinMove A, , 300, 50, 1024, 1001,
Returnwill move the active window 300 pixels in from the left and 50 pixels down from the top. It will resize the window to 1024 pixels wide and 1001 pixels high.

The hotkey combination is Windows + 1

I use this particular hotkey to resize my browser.

If the window is already maximised when this hotkey is used, it remains maximised in the new position and size so that clicking on the maximise / restore button in the top right will restore the window to the previous non-maximised size.

You should try Winsplit revolution, not a real maximize but you can define regions and hotkeys. Main site seem down, here is a link (I'm french, don't mention it...  :D )

Keep in mind that you could adapt Antonimo's code to work for various windows to be resized/moved depending on which window has focus, all fired with the same hotkey.  See IfWinActive, etc.

Hmm, I think what I'm going to try to make is to make an "add-on" script for Desktop Coral. It should read the .ini values, and when the user presses a hot key, it will move the the active window (and resizing it) to fit the area that's covered. This is less work for me, and it makes good use of an already existing program.



[0] Message Index

[#] Next page

[*] Previous page

Go to full version