Center New Windows
Opens all new windows centered on the screen, including UWP and WinUI apps
Author: crazyboyybs
Automatically centers newly created application windows on the active
monitor, similar to the default behavior in macOS. Also centers UWP and
WinUI application windows such as Windows Settings, Microsoft Store,
Calculator, and other modern apps.
What's new in 1.0.1
SetWindowPos grace period — after a window is first centred, a
2-second grace period blocks any SetWindowPos call that tries to move
it elsewhere. This fixes a known issue with Firefox-based browsers
(Firefox, Floorp, Zen, LibreWolf and others) that restore their saved
session position via SetWindowPos ~700 ms after ShowWindow,
overriding the centred position.
- Vertical offset setting — shifts the centred position up or down by
a fixed number of pixels. Useful for third-party docks or status bars
that are not reflected in the system work area.
- DPI-unaware app fix — windows and dialogs that belong to processes
using system scaling (e.g. Audacity, older Win32 apps) are now correctly
centred at all scale levels. The previous calculation mixed physical
monitor coordinates with virtual window coordinates, placing windows
above and to the left of true centre.
Regular windows
The mod hooks ShowWindow() and SetWindowPos() in every process.
When a suitable window is shown for the first time, it is optionally
resized and then centered on the monitor before becoming visible.
A 2-second grace period prevents apps from overriding the centered
position. This is needed for apps like Firefox and Floorp that restore
their saved session position via SetWindowPos after ShowWindow.
During the grace period, any SetWindowPos call that tries to move
a recently centered window is silently redirected back to the centered
position. The user can still move windows manually after the grace
period expires.
Windows restored from the system tray (e.g. WhatsApp, Discord) are
always re-centered but the grace period is not applied on
restore — only on first appearance.
Owned windows — dialogs, settings panels, export windows, the Run
dialog, and similar pop-ups — are intentionally ignored by default.
The Always center dialogs option is an exception: when enabled,
standard Win32 dialogs (window class #32770) such as the file picker,
print dialogs, and font pickers are always centered every time they
appear. Child dialogs inside property sheets and sub-dialogs are
automatically excluded.
Some applications reposition their windows after ShowWindow. For those
cases, the Fade Trick can be enabled in settings to temporarily make
the window transparent while it is being repositioned.
UWP and WinUI windows
UWP windows have two layers:
- ApplicationFrameWindow — the top-level frame (title bar, borders)
- CoreWindow — the app content, positioned as a child of the frame
The Windows shell (explorer.exe) positions the CoreWindow via
SetWindowPos. This mod detects that moment, finds the parent
ApplicationFrameWindow, and moves the frame to the center of
the screen. A grace period prevents the shell from overriding the
centered position.
As a fallback, the mod also intercepts ShowWindow in
ApplicationFrameHost.exe to catch frames at first appearance,
using short timer-based polling until the frame has its real size.
Note: Some UWP apps like Microsoft Store may show a brief position
jump when opening. This happens because these apps create and
reposition multiple internal windows during initialization, and the
shell may momentarily override the centered position before the grace
period takes effect.
Settings
Fade Trick + Fade delay (ms)
When Fade Trick is enabled, the window is made transparent before
being shown, repositioned while invisible, and then restored after
the configured delay.
At 60 Hz one frame takes about 16 ms; the default value of
25 ms adds a small safety margin.
Safe range: 1–500 ms.
Resize windows to default size
When enabled, new windows are resized to the configured width and
height before being centered. Dialogs and UWP windows are never resized.
Always center dialogs
When enabled, all standard Win32 top-level dialogs (#32770) are
centered every time they appear. This includes file pickers (Save As,
Open File), print dialogs, font pickers, and other standard dialogs.
Child dialogs inside property sheets (such as the tab pages in
"Drive Properties") and sub-dialogs opened from another dialog are
automatically excluded — only the first-level dialog is ever centered.
Center UWP and WinUI windows
When enabled, UWP and WinUI application windows (Settings, Store,
Calculator, etc.) are centered on the screen when they first appear.
Vertical offset
Shifts the centered position up or down by a fixed number of pixels.
Useful if you use a third-party dock (e.g. MyDockFinder, Nexus) or a
status bar that is not reflected in the system work area.
Use a negative value to move windows up, or a positive value
to move them down. Default is 0 (no offset).
Exclusion lists
The mod maintains an internal list of always-excluded processes and
window classes that are known to break or have no visible content.
You can add your own entries in the settings panel for any additional
apps or window classes you want to skip.
Always excluded (hardcoded processes):
| Entry |
Reason |
photoshop.exe |
Adobe Photoshop — blank layout after splash |
shellexperiencehost.exe |
Start menu, Action Center |
startmenuexperiencehost.exe |
Start menu |
searchhost.exe |
Windows Search UI |
lockapp.exe |
Lock screen |
systemsettings.exe |
Windows Settings (UWP host process) |
textinputhost.exe |
Touch keyboard / emoji panel |
widgets.exe |
Windows Widgets |
phoneexperiencehost.exe |
Phone Link host |
gamebarpresencewriter.exe |
Xbox Game Bar |
runtimebroker.exe |
UWP permission broker |
dllhost.exe |
COM surrogate host |
sihost.exe |
Shell Infrastructure Host |
taskhostw.exe |
Task scheduler host |
ctfmon.exe |
Input method framework |
credentialuibroker.exe |
Credential dialog broker |
windowsterminal.exe |
Manages its own window |
backgroundtaskhost.exe |
Background task runner |
securityhealthsystray.exe |
Windows Security tray |
onedrive.exe |
OneDrive tray pop-up |
mspcmanager.exe |
PC Manager tray pop-up |
msedgewebview2.exe |
WebView2 embedded browser |
conhost.exe |
Console host |
svchost.exe |
Service host |
Always excluded (hardcoded classes):
| Entry |
Reason |
MsoSplash |
Office splash screens |
Microsoft.UI.Content.PopupWindowSiteBridge |
WinUI pop-up host |
DropdownWindow |
Generic drop-down menus |
Windows.UI.Core.CoreWindow |
UWP core window |
Shell_TrayWnd |
Taskbar |
Shell_SecondaryTrayWnd |
Secondary monitor taskbar |
NotifyIconOverflowWindow |
Tray overflow area |
Progman |
Desktop program manager |
WorkerW |
Desktop wallpaper worker |
Windows.UI.Input.InputSite.WindowClass |
Input site host |
XamlExplorerHostIslandWindow |
XAML island host |
How DPI scaling is handled
For DPI-unaware applications (older Win32 apps that rely on the OS to scale
their windows), GetWindowRect returns coordinates in virtual pixels while
GetMonitorInfo always returns physical pixels. Mixing the two without
correction places windows above and to the left of true centre.
The fix detects virtualisation by comparing GetWindowRect against
DWMWA_EXTENDED_FRAME_BOUNDS (which always returns physical pixels). When a
mismatch is found, GetDpiForSystem() supplies the exact system scale factor,
which is used to convert the monitor work area to virtual pixels before the
centred position is computed.
Centralizar Novas Janelas Automaticamente
Centraliza automaticamente novas janelas de aplicativos no monitor
ativo, de forma semelhante ao comportamento do macOS. Também centraliza
janelas UWP e WinUI como Configurações, Microsoft Store, Calculadora
e outros apps modernos.
Um grace period de 2 segundos impede que apps como Firefox e Floorp
sobrescrevam a posição centralizada ao restaurar a posição salva da
sessão anterior.
A centralização lida corretamente com aplicativos que não suportam
nativamente alta DPI: ao detectar que o OS está virtualizando
coordenadas, o mod converte a área de trabalho do monitor para o espaço
de pixels virtual antes de calcular a posição centralizada.
Sempre excluídos (fixos no código):
O mod mantém uma lista interna de processos e classes de janela sempre
excluídos. Você pode adicionar exclusões adicionais nas configurações.
Centrar Nuevas Ventanas Automáticamente
Centra automáticamente las nuevas ventanas de aplicaciones en el
monitor activo, similar al comportamiento de macOS. También centra
ventanas UWP y WinUI como Configuración, Microsoft Store, Calculadora
y otras apps modernas.
Un grace period de 2 segundos impide que apps como Firefox y Floorp
sobrescriban la posición centrada al restaurar la posición guardada
de la sesión anterior.
El centrado maneja correctamente las aplicaciones que no soportan
nativamente DPI alto: al detectar que el SO está virtualizando
coordenadas, el mod convierte el área de trabajo del monitor al
espacio de píxeles virtual antes de calcular la posición centrada.
Siempre excluidos (fijos en el código):
El mod mantiene una lista interna de procesos y clases de ventana
siempre excluidos. Puede agregar exclusiones adicionales en la
configuración.