Hacker News new | ask | show | jobs
by jmlucjav 1934 days ago
can you save different 'layouts' so you can load a different one in diff context?
1 comments

No. It's pretty bare-bones. Save before a disconnect, restore after re-connect.

And it's hWnd based, so if the window handle ever changes it won't work. Also won't work for admin windows, unless run as an admin.

But it worked well enough for me.

Oh wow, the hwnd approach is an awesome idea! I suffer from a different issue - my monitor has a displayport and 2 hdmi inputs, and when you activate one of the hdmi inputs, the other sends a "monitor disconnected" signal to its host, which messes up the layout. It would be awesome to have an app that constantly remembers the layout, and once it detects a change in the number of monitors, or a resolution change, it stops doing it until the monitor returns, and it does, it restores windows to the saved places. Sounds easy enouch, and I'll probably create this app myself based on examples from your code.
I had wanted to do that, but when I created it I was using a proprietary ThinkPad dock and Windows 7, and I couldn't find an easy way to detect when connected/disconnected. Might be a way now with Win10 and Type-C docks.