-
Notifications
You must be signed in to change notification settings - Fork 711
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
Question: is ActiveX Control support possible/planned for WinUI 3 ? #4670
Comments
@ryandemopoulos fyi |
Hi, any new about this? |
There aren't plans in the near future to add ActiveX control hosting in WinUI 3. The easiest option would be to host the ActiveX control via a child HWND (using the HWND from the WinUI window as the parent), but that will have airspace issues. It would be far more complicated to try to host without the airspace limitation. |
Thanks for this answer. It's sad there's no plan as there are lots of legacy (possibly huge) win32 apps that could be migrated more smoothly if there was a way to integrate parts of them in a WinUI3 host. I understand the reverse is possible (~Xaml islands) but seems to make less sense to me for a migration phase. Anyway, is it possible to use a SwapChainPanel with its own HWND? Or is this what you mention in your answer? |
I'm not sure what you mean. You can have the ActiveX hosted on top of all WinUI3 content by hosting it as a child HWND, but SwapChainPanel isn't needed/helpful for this. You could try to not have a visible child HWND by instead implementing windowless ActiveX hosting, which would involve having the ActiveX control render into a bitmap which you could copy into a surface for a SwapChainPanel or SurfaceImageSource, plus implementing mouse and keyboard forwarding and hooking up Accessibility (UIA). The windowless hosting model is clearly much more complicated, and usually has lots of edge cases which need to be handled to get a good experience (for example: ensuring you can smoothly tab in/out of the hosted control). |
I would also like to see ActiveX control hosting in WinUI 3. My specific use case revolves around the ActiveX RDP client. A (really) nice alternative would be a native WinUI 3 RDP Control. |
As codendone said, you can host any ActiveX with a child window... but it needs a Win32 region, in particular since 1.1.0 (because of the background they added) |
@castorix thanks for the pointer to |
I made some samples in C# wth various ActiveX controls, but I just tested (in C++ first) with MS RDP ActiveX (from "C:\Windows\System32\MsTscAx.dll" ), but I could not make it work (I tested with rdp_test_page, while it works if I test with mstsc.exe) |
Thanks for giving it a try - really appreciate that. I guess I'll have to consider falling back to WPF and .NET Core 3.1 for this project. |
The problem is that MS RDP ActiveX worked before in any language |
I made a basic sample (Server/User/Password and a few parameters) in C#/Windows App SDK 1.1.0 with MSRDP ActiveX |
@castorix - clearly not for the faint of heart 😃 even if complexity may be due do this particular RDP control, that's why I do think there should be "some level" of builtin support for Active X Controls in WinUI3, at least some guidance and/or tutorials. |
@castorix - thanks for working through this. The complexity is unfortunate but at least it gives me a place to start. I need to manage multiple RDP connections in a complex UI so this will be challenging. @smourier - I fully agree that there should be some stronger guidance and tooling for using ActiveX controls with WinUI 3. |
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
Hi,
I may be mistaken, but I've not seen any information on that.
We have it with WPF: https://docs.microsoft.com/en-us/dotnet/desktop/wpf/advanced/walkthrough-hosting-an-activex-control-in-wpf, we have it with Winforms: https://docs.microsoft.com/en-us/dotnet/desktop/winforms/controls/how-to-add-activex-controls-to-windows-forms
So will we have it with WinUI 3? Otherwise is there a way to write a custom control maybe? any guidance? will it be technically possible (no airspace-like issue)?
Thanks
The text was updated successfully, but these errors were encountered: