Maximize and Aero snap on DockableFloatingWindow Maximize and Aero snap on DockableFloatingWindow wpf wpf

Maximize and Aero snap on DockableFloatingWindow


you could run an external process, using runtime:

download nircmd.exe from: http://www.nirsoft.net/utils/nircmd.htmland make sure it is in the same directory as the .class file or in the windows PATH environment variable

then use Runtime.exec() to run it several times:

Runtime r=Runtime.getRuntime();r.exec("nircmd.exe sendkey lwin down");r.exec("nircmd.exe sendkey "+direction+" press");//change direction to "right" (for right side), "left" (for left side), or "up" (for full window).r.exec("nircmd.exe sendkey lwin up");

note that this can throw an IOException, so a try/catch block might be necessary.

note:this assumes that the window is the active one.


anon said “Unfortunately is also disables, Windows + Up or Down arrow for Max./Min. the active Window.”

vIBIUS said “This also disables the Windows Key + Shift and Left/Right option!”

Kermonk said “unfortunately that also disables the “shake window to close all other windows” feature…”

Try this:

[HKEY_CURRENT_USER\Control Panel\Desktop]"DockMoving"="0"

It disables the mouse action to maximise windows and snap windows to the side but not the keyboard shortcuts. It does not affect AeroPeak or AeroShake. It also does not affect ‘maximising a window in a verticle direction only’.


For who is interested latest version of AvalonDock (version 2) natively supports floating window aero snap feature.AvalonDock 2.0 is still in beta, more info:http://avalondock.codeplex.com/New features:http://avalondock.codeplex.com/wikipage?title=Version2Concept