A Microsoft platform for building and publishing apps for Windows devices.
For a Print Support App (or any WinUI 3 / Windows App SDK window) the resize behavior is controlled via the windowing APIs, not via the printer preferences entry point itself.
To restrict user resizing, use the AppWindowPresenter (typically OverlappedPresenter) associated with the app’s AppWindow:
- Get the
AppWindowfor the current window. - Cast its
PresentertoOverlappedPresenter. - Configure the presenter:
- Set
IsResizabletofalseto prevent user resizing. - Optionally set
PreferredMinimumWidth/HeightandPreferredMaximumWidth/Heightto constrain the size range.
- Set
Example (C# / Windows App SDK):
using Microsoft.UI.Windowing;
using Microsoft.UI.Xaml;
public sealed partial class MainWindow : Window
{
public MainWindow()
{
this.InitializeComponent();
var hwnd = WinRT.Interop.WindowNative.GetWindowHandle(this);
var windowId = Win32Interop.GetWindowIdFromWindow(hwnd);
var appWindow = AppWindow.GetFromWindowId(windowId);
if (appWindow.Presenter is OverlappedPresenter presenter)
{
presenter.IsResizable = false; // disable user resize
// Optional: constrain size if needed
presenter.PreferredMinimumWidth = 400;
presenter.PreferredMinimumHeight = 300;
presenter.PreferredMaximumWidth = 400;
presenter.PreferredMaximumHeight = 300;
}
}
}
Notes based on the platform behavior:
-
IsResizable = falsehides the resize controls and prevents user resizing, but does not block programmatic calls toAppWindow.Resize. -
PreferredMinimumHeight/WidthandPreferredMaximumHeight/Widthconstrain both user resizing andAppWindow.Resizecalls; the window cannot be resized outside that range. - If a fixed-size dialog is desired, set min and max to the same values and keep
IsMaximizablefalse.
This approach lets the Print Support App’s printing-preferences window behave like a fixed-size dialog when invoked from printer properties.
References: