WinUI 3 window does not open in fullscreen after closing in fullscreen to the system tray

youki 1,016 Reputation points
2022-11-25T15:03:20.99+00:00

Hi,
I am not sure, if this is a bug or if i have to handle it myself.
It is a unpackaged c++ app and the window is callable (can be opened) by an icon in the system tray.
It is like the title says. If i open the window and maximize it by double clicking in the title bar, the window gets maximized to fullscreen and fills the entire monitor.
If i close the window by the red x button as desired (the application is still running) and i open it again by the system tray icon, the window is not maximized.
Is this a bug, should not the application save the window state automatically?

It is weird because it saves the state when it's not maximized to fullscreen.

Regards

Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
749 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,628 questions
{count} votes

1 answer

Sort by: Most helpful
  1. youki 1,016 Reputation points
    2022-11-28T18:14:47.227+00:00

    Ok,
    Got it fixed:
    https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-showwindow

    Not this:

    ShowWindow(MainWindow::s_handle, SW_NORMAL);  
    

    Fix:

    ShowWindow(MainWindow::s_handle, SW_SHOW);  
    

    Thank you.

    0 comments No comments