davidortinau / WeatherTwentyOne

MIT License
927 stars 220 forks source link

WindowExtensions.MinimizeToTray() method does not work #62

Closed shv07 closed 2 years ago

shv07 commented 2 years ago

The above method does not cause any change to the app. Upon debugging I noticed that the window handle Hwnd is always IntPtr.Zero. I was able to to however make it work with the below code :-

.
.
Hwnd = ((MauiWinUIWindow)App.Current.Windows[0].Handler.PlatformView).WindowHandle;
.
.

Is it the correct way or am I missing something here? All my setup are according to the latest official docs.