10

I would like to be able to stop windows from being dragged past the border of the screen. For example, open a window that is not maximized, click the top bar with the mouse and drag the window wherever you want. Now drag the window to the left/right/top/bottom of your screen and notice that part of the window goes off screen. I would like the window to bump up against the edge of the screen and go no further.

In the same way the cursor can't go over the edge on the left side, I would like to make a barrier so windows can't move over it either.

The main reason for doing this is because I am making a batch program in which I need it to not go off screen. This is annoying and I was hoping that someone here could be of some help.

Sorry if this is an obvious question, I tried a few searches but had no idea what terms to look up.

Thanks for any help in advance!

Elliot King
  • 77
  • 10
  • https://stackoverflow.com/questions/10392620/how-can-a-batch-file-run-a-program-and-set-the-position-and-size-of-the-window/ (cannot flag - open bounty) – Alexandru Clonțea Mar 02 '18 at 10:15
  • This is one of the most annoying things about Win10. It allows windows to float offscreen which is pointless because you can't see them. It's also sorely lacking at rapid window layouts. Visual Studio has a decent window docking system that could easily be added to the OS. Sure there is stardock and other bolt-on stuff, but should Win10 still be this clunky at its namesake? So embarassing. I was compelled to rant about this after trying to split my screen into 1/4 1/4 1/2 windows and laughing at how difficult it is compared to Visual Studio... – Chris C Jan 05 '20 at 23:48
  • Forgot to add this. It doesn't answer the question, but it does make window layouts easier... https://www.reddit.com/r/windows/comments/2rn775/best_tiled_window_manager_for_windows/ and https://en.wikipedia.org/wiki/Tiling_window_manager#Third-party_addons – Chris C Jan 06 '20 at 00:10

4 Answers4

5

Sorry for the late response (I was researching this), but here is the answer:

There is no current way to do this easily. I'm sure you can edit windows src code and add that property, but the language it is made in is not in batch and it would be EXTREMELY hard to edit these files :(

Also, this would affect all windows, not only that specific program, meaning no easy shortcut for split screen. So no, you cannot do this.

Elliot King
  • 77
  • 10
2

On Windows 10 you can simply move a window near the edge of the screen and it will auto-fit on screen. You can also use shortcuts to do this. [Windows key] + [arrow left] or [arrow right]

EPurpl3
  • 682
  • 7
  • 25
0

you were able to change a setting in windows 7 to prevent this. I know that this is a feature if you are using multiple monitors but if using only one monitor there should be a way to change a setting. thank you Microsoft once again for making our lives complicated. the more you guy release a new windows the harder it is to use.

0

Finally i found real solution for this.

I was searching a real solution for my application. There are many tricks but using reg we need to restart computer.

You can disable it from powershell. You need to call this file from your code.

Here is link. Check download file at bottom called "DisableAeroSnap.ps1" https://michlstechblog.info/blog/windows-disable-aerosnap-automatically-window-arranging-and-resizing-while-dragging/#more-951

haseakash
  • 31
  • 1
  • 6