Skip to content

Question: Is PersistenceId necessary in WinAppSdk/WinUI3? #178

Closed

Description

@0x5bfa

I'm experimenting with an app that uses WinUIEx.
Almost of all are already implemented within WinAppSdk expect for min width, min height and persistence id. While min width and height can be set using WndProc when window tries to get the info with message code WM_GETMINMAXINFO, I couldn't find any alternatives for persistence id.

I looked into the WinUIEx source code and I find actual store/restore routine here:

Windows.Win32.PInvoke.SetWindowPlacement(new Windows.Win32.Foundation.HWND(_window.GetWindowHandle()), in retobj);

If I understand this correctly, this stores WINDOWPLACEMENT struct data in case dev customizes that data in their code using SetWindowPlacement.
If I don't set that, is it necessary to set?

Activity

  1. dotMorten commented on Aug 3, 2024

    @dotMorten
    Owner

    It’s not necessary. You only need to set it if you want the app to launch where it was closed.

  2. Repository owner locked and limited conversation to collaborators on Aug 3, 2024
  3. converted this issue into a discussion #179 on Aug 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions