See the question and my original answer on StackOverflow

You have two problems

so this should work:

Windows::Foundation::IAsyncAction winrt::App1::implementation::Tab1Page::Button_Click(IInspectable const& sender, RoutedEventArgs const& args)
{
  auto hwnd = GetFirstProcessWindowHandle();

  auto picker = winrt::Windows::Storage::Pickers::FileOpenPicker();
  picker.FileTypeFilter().Append(L"*");

  auto initializeWithWindow{ picker.as<IInitializeWithWindow>() };
  initializeWithWindow->Initialize(hwnd);
  picker.SuggestedStartLocation(winrt::Windows::Storage::Pickers::PickerLocationId::Desktop);
  auto file = co_await picker.PickSingleFileAsync();
}