You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Revit stores the position and size of its hidden main window when a session started with /runhidden closes.
The next Revit the user starts reads them and opens a small window in a corner of the screen.
sequenceDiagram
participant Hidden as Revit started with /runhidden
participant Settings as Settings of the user
participant Next as Next Revit
Hidden->>Hidden: Move the main window to 30000,0 at 500x400
Hidden->>Settings: On close, write windowPlacement = 30000,0,500,400
Hidden->>Settings: On close, write Maximized = 0
Next->>Settings: Read windowPlacement and Maximized
Next->>Next: Move the window onto the screen at 500x400, restored
Loading
Where Revit stores the window
Setting
Location
Value after a hidden session
Restored position and size
HKCU\Software\Autodesk\Revit\Autodesk Revit <year>\App, value windowPlacement
A longer session writes a wider rectangle, for example 30000,0,864,400.
The registry of Revit 2023 to 2027 shows the same values.
How Revit writes the settings
The steps below come from the decompiled Revit 2027 binaries.
At startup with /runhidden, UIFramework.MainWindow.MainWindow_SourceInitialized sets Left = 30000, Top = 0, Width = 500, and Height = 400. DesktopMFCApp::InitNativeInstance in DesktopMFC.dll moves the native frame to the same rectangle.
The window is visible off the screen, not hidden.
InitNativeInstance applies the stored Maximized value only to a session started without /runhidden.
Two handlers write the settings when the main window closes.
Neither checks /runhidden:
MainWindow_Closing in UIFramework.dll writes Maximized.
It writes the position and size of a restored window.
MFCMainFrame::OnClose in RevitMFC.dll writes the position and size for every window state.
MFCMainFrameUtil::saveWindowPlacement writes rcNormalPosition of GetWindowPlacement as left,top,width,height.
At the next start, MFCMainFrameUtil::setLargeWndSize reads windowPlacement. ScreenLayoutUtil::fitRectOnScreen moves the rectangle onto the screen and does not change its size.
The closing handler of the WPF main window reads as follows:
Hide with WindowState.Maximized before exit makes MainWindow_Closing write Maximized=1. MFCMainFrame::OnClose still writes 30000,0,500,400.
The next Revit opens maximized. Restore Down returns the small window in the corner.
A user who works in a restored window gets a maximized one after every run.
Restoring the settings
Two approaches were tested on Revit 2027:
Restore after exit reads both settings before the hidden session starts and writes them back after the Revit process exits.
Window state before exit hides the main window before ExitRevit, applies the stored rectangle through SetWindowPlacement, and maximizes the window when Maximized=1.
Settings before the run
Restore after exit
Window state before exit
200,150,1400,900, maximized
Unchanged
Unchanged
200,150,1400,900, restored
Unchanged
Unchanged
No windowPlacement, maximized
Unchanged
30000,0,500,400 written
30000,0,500,400 of an earlier run
windowPlacement removed
30000,0,500,400 written
Without windowPlacement, Revit opens a restored window at 99% × 98% of the work area.
A normal start of Revit 2027 after each restored run opened the window the settings describe: maximized, or restored at 300,200 with the size 1200x800.
Settings already damaged
Remove the stored position of every affected version, for example Revit 2027:
A test session reads windowPlacement and [Windows] Maximized before Revit starts and writes both back after Revit exits. The session removes a windowPlacement at 30000,0: an earlier run wrote it.
Rejected: setting the window state before ExitRevit. MFCMainFrame::OnClose writes the position for every window state. The closing handlers cannot restore a missing value or remove a damaged one.
Rejected: Hide with WindowState.Maximized. Every user gets a maximized Revit. Restore Down returns the 500x400 window.
Rejected: fitting the window onto the screen at the next start. Revit already does it in ScreenLayoutUtil::fitRectOnScreen. The damaged setting is the size: a 500x400 window fits on the screen.
Activity
Nice3point commentedon Nov 1, 2026
Investigation
Revit stores the position and size of its hidden main window when a session started with
/runhiddencloses.The next Revit the user starts reads them and opens a small window in a corner of the screen.
sequenceDiagram participant Hidden as Revit started with /runhidden participant Settings as Settings of the user participant Next as Next Revit Hidden->>Hidden: Move the main window to 30000,0 at 500x400 Hidden->>Settings: On close, write windowPlacement = 30000,0,500,400 Hidden->>Settings: On close, write Maximized = 0 Next->>Settings: Read windowPlacement and Maximized Next->>Next: Move the window onto the screen at 500x400, restoredWhere Revit stores the window
HKCU\Software\Autodesk\Revit\Autodesk Revit <year>\App, valuewindowPlacement30000,0,500,400%APPDATA%\Autodesk\Revit\Autodesk Revit <year>\Revit.ini, section[Windows], keyMaximized0A longer session writes a wider rectangle, for example
30000,0,864,400.The registry of Revit 2023 to 2027 shows the same values.
How Revit writes the settings
The steps below come from the decompiled Revit 2027 binaries.
/runhidden,UIFramework.MainWindow.MainWindow_SourceInitializedsetsLeft = 30000,Top = 0,Width = 500, andHeight = 400.DesktopMFCApp::InitNativeInstanceinDesktopMFC.dllmoves the native frame to the same rectangle.The window is visible off the screen, not hidden.
InitNativeInstanceapplies the storedMaximizedvalue only to a session started without/runhidden.Neither checks
/runhidden:MainWindow_ClosinginUIFramework.dllwritesMaximized.It writes the position and size of a restored window.
MFCMainFrame::OnCloseinRevitMFC.dllwrites the position and size for every window state.MFCMainFrameUtil::saveWindowPlacementwritesrcNormalPositionofGetWindowPlacementasleft,top,width,height.MFCMainFrameUtil::setLargeWndSizereadswindowPlacement.ScreenLayoutUtil::fitRectOnScreenmoves the rectangle onto the screen and does not change its size.The closing handler of the WPF main window reads as follows:
The Hide and Maximized workaround
HidewithWindowState.Maximizedbefore exit makesMainWindow_ClosingwriteMaximized=1.MFCMainFrame::OnClosestill writes30000,0,500,400.The next Revit opens maximized.
Restore Down returns the small window in the corner.
A user who works in a restored window gets a maximized one after every run.
Restoring the settings
Two approaches were tested on Revit 2027:
ExitRevit, applies the stored rectangle throughSetWindowPlacement, and maximizes the window whenMaximized=1.200,150,1400,900, maximized200,150,1400,900, restoredwindowPlacement, maximized30000,0,500,400written30000,0,500,400of an earlier runwindowPlacementremoved30000,0,500,400writtenWithout
windowPlacement, Revit opens a restored window at 99% × 98% of the work area.A normal start of Revit 2027 after each restored run opened the window the settings describe: maximized, or restored at
300,200with the size1200x800.Settings already damaged
Remove the stored position of every affected version, for example Revit 2027:
reg delete "HKCU\Software\Autodesk\Revit\Autodesk Revit 2027\App" /v windowPlacement /fThe next Revit opens at its default size.
Maximize it and close it to store
Maximized=1.Nice3point commentedon Nov 1, 2026
Decision
A test session reads
windowPlacementand[Windows] Maximizedbefore Revit starts and writes both back after Revit exits. The session removes awindowPlacementat30000,0: an earlier run wrote it.ExitRevit.MFCMainFrame::OnClosewrites the position for every window state. The closing handlers cannot restore a missing value or remove a damaged one.HidewithWindowState.Maximized. Every user gets a maximized Revit. Restore Down returns the 500x400 window.ScreenLayoutUtil::fitRectOnScreen. The damaged setting is the size: a 500x400 window fits on the screen.Nice3point commentedon Nov 1, 2026
https://github.com/Nice3point/RevitUnit/releases/tag/2027.0.9