"Hosted HWND must be a child window of the specified parent."

Add-in Express™ Support Service
That's what is more important than anything else

"Hosted HWND must be a child window of the specified parent."
Outlook Addin Issue 
Pino Carafa




Posts: 162
Joined: 2016-09-28
Hello Add-in Express

I was getting the above error in our Add-in. When I googled for this, I found a question I asked earlier:

https://www.add-in-express.com/forum/read.php?TID=15128

When I saw your suggestion to "Optimize for compatibility" I checked Outlook on my new laptop and sure enough it was set to "Optimize for best appearance" instead of "Optimize for compatibility", and when I switched to that option the problem went away.

Great, right?

Except I then went to tell my colleague about it. He had the same problem. He is using a laptop with an additional monitor attached to it. I told him to go to File - Options..... and "When using multiple displays" is missing.

He has Outlook 365 so I would think his Outlook is not so old that that might explain why it's missing.

Is there a way to change this setting through the Registry if it's missing from File - Options?
Posted 11 Feb, 2021 08:23:54 Top
Pino Carafa




Posts: 162
Joined: 2016-09-28
By the way: I am currently using Add-in Express build 9.5.4661
Posted 11 Feb, 2021 13:15:52 Top
Pino Carafa




Posts: 162
Joined: 2016-09-28
Ok I think I may have been barking up the wrong tree here. My colleague had the problem on a VM. When I asked him to check the "Optimize for ... " settings he checked it on his own PC, where, as mentioned above, those settings were not available for him to change.

When he realised that he was looking at the wrong machine he checked in the VM and both the settings in File - Options and in the Registry are there and he can change them. I assume that he can therefore change them as suggested and that that will address the problem. I'll let you know if that isn't the case. Sorry for leading you down the garden path.
Posted 12 Feb, 2021 05:02:03 Top
Andrei Smolin


Add-in Express team


Posts: 18823
Joined: 2006-05-11
Hello Pino,

I believe you know that one day you would need to solve this rather than use that workaround.


Andrei Smolin
Add-in Express Team Leader
Posted 15 Feb, 2021 09:36:44 Top
Pino Carafa




Posts: 162
Joined: 2016-09-28
Yes indeed. I think the issue is caused by us using a WebBrowser control in some WPF dialogs as a host for "previewing" some files the user may wish to attach to an email from our software's document store.

We are currently looking at Microsoft's new WebView2 control for some documents and the DocumentViewer for documents we can easily convert to XPS as it looks like neither of those controls suffer from this problem ...

Wish us luck :)
Posted 15 Feb, 2021 11:52:16 Top
Andrei Smolin


Add-in Express team


Posts: 18823
Joined: 2006-05-11
Good luck! :)


Andrei Smolin
Add-in Express Team Leader
Posted 16 Feb, 2021 09:08:03 Top