Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Align a window to an edge of a screen
ResourceFunction["Win32AlignWindow"][hwnd,edge] aligns a window specified by hwnd with the given edge of a screen. | |
ResourceFunction["Win32AlignWindow"][func,edge] finds the window for which the given function returns True when passed the window's title and aligns it with the given edge of the screen. |
| "Proportion" | 0.5 | proportion of the screen the window should occupy |
| "Screen" | 1 | screen on which to place the window |
| "ResizeSecondaryDimension" | True | if aligning to left/right edge, the secondary dimension is the height, and is otherwise the width |
| "WindowsUIScale" | 1 | value of Windows setting found at System >Display > Scale & Layout > Scale |
Align the messages window with the right half of the screen:
| In[1]:= |
Align the messages window with the right half of the second screen:
| In[2]:= |
Align the messages window with the right third of the screen:
| In[3]:= |
Align the messages window with the left side of the screen, but do not alter its width:
Align the message window to the top edge of the screen, but do not change its width or height:

Align the message window to the bottom edge of the screen and compensate for the Windows setting found in System > Display > Scale & Layout > Scale being set to 200%:
Create scripts to arrange your windows for working on particular types of problems:
| In[4]:= | ![]() |
Win32AlignWindow is only supported on Windows operating systems:
| In[5]:= |
| Out[5]= |
| In[6]:= |
| Out[6]= |
Windows may be sized incorrectly if WindowsUIScale is not set correctly.
This work is licensed under a Creative Commons Attribution 4.0 International License