Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add IWindowNative (microsoft.ui.xaml.window.h) #538

Closed
riverar opened this issue Jun 19, 2021 · 8 comments
Closed

Add IWindowNative (microsoft.ui.xaml.window.h) #538

riverar opened this issue Jun 19, 2021 · 8 comments
Labels
missing api Some documented API is missing from the metadata

Comments

@riverar
Copy link
Collaborator

riverar commented Jun 19, 2021

IWindowNative is in a weird spot. It's in the realm of MUX and owned by their team but it's not an API they'll want to add to their metadata (Microsoft.UI.winmd) for, well, HWND reasons.

But all MUX developers will need this, if they want to perform basic window operations, such as resizing the window (overriding the non-ideal 50%-width-of-display behavior), setting window styles, or even a window title.

There is no indication WinUI 3 will support these operations in time for Project Reunion 1.0 GA.

@mikebattista mikebattista added the missing api Some documented API is missing from the metadata label Jun 20, 2021
@mikebattista
Copy link
Collaborator

Thanks. Sounds like another case of #66 which is something we are working on. We'll look into it.

@kennykerr
Copy link
Contributor

fyi @jonwis reunion/winui should ship a winmd with this definition.

@angelazhangmsft
Copy link

@riverar - FYI, for C#/.NET 5 we have added COM interop APIs to the Windows SDK projections, and this will ship in the July .NET 5 SDK update:

This will make it easier to call interop functions in C#, for example:

var hwnd = WinRT.Interop.WindowNative.GetWindowHandle(this);
var folderPicker = new FolderPicker();
WinRT.Interop.InitializeWithWindow.Initialize(folderPicker, hwnd);

We are working on the documentation for these new APIs.

@kennykerr
Copy link
Contributor

That helps C# but not any other language (like C++ or Rust) as that knowledge is baked/hardcoded into the C# projection. Ideally, we can have metadata that defines this for every language.

@riverar
Copy link
Collaborator Author

riverar commented Jul 27, 2021

Any updates on this? Emission of IWindowNative helpers in C#/WinRT is not helpful. Why is this such a weird wart? Politics?

@kennykerr
Copy link
Contributor

It does seem awkward that the Win32 metadata includes IInitializeWithWindow but not IWindowNative. They're two sides of the same coin.

@sotteson1
Copy link
Contributor

Any updates on this? Emission of IWindowNative helpers in C#/WinRT is not helpful. Why is this such a weird wart? Politics?

Sorry we haven't made progress on this. It's not a problem of politics--we definitely want to have this available to projections. The problem is that this API isn't part of the Windows SDK which is what win32metadata scrapes into the main .winmd. We are working to have the Windows App SDK scrape its headers and provide additional .winmd files in its packages, but we aren't there yet. We're working on it and hope to have it available soon, but it won't show up in Windows.Win32.winmd, it will be in a .winmd that the Windows App SDK ships.

@riverar
Copy link
Collaborator Author

riverar commented Sep 8, 2022

Just closing old issues. Since creating this issue, I was able to successfully generate any needed metadata for the entire Windows App SDK, so this isn't really needed anymore.

@riverar riverar closed this as not planned Won't fix, can't repro, duplicate, stale Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
missing api Some documented API is missing from the metadata
Projects
None yet
Development

No branches or pull requests

5 participants