Skip to content
Discussion options

You must be logged in to vote

i have just posted an updated answer to this question here - it's a solution for Windows:
#2370 (comment)

I have another option that doesn't rely on PInvoke directly and works >preview12. To work with AppWindow from Microsoft.UI.Windowing you need to get the WindowId from the window handle.

The AppWindow object provides functionality like Resize or MoveAndResize

        Microsoft.Maui.Handlers.WindowHandler.WindowMapper.AppendToMapping(nameof(IWindow), (handler, view) =>
        {
#if WINDOWS
            var nativeWindow = handler.NativeView;
            nativeWindow.Activate();

            IntPtr hWnd = WinRT.Interop.WindowNative.GetWindowHandle(nativeWindow);
            WindowId wind…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jiangk576
Comment options

Answer selected by jiangk576
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants