"Optimize for compatibility" strongly implies there is a compatibility problem. You need to determine what old library is causing that and then modernize what you use. Nearly certainly it is the WebBrowser control. It has been more than two years since I have done that type of thing but apparently you need to convert to the WebView2 Class (WebView2 control).
"Hosted HWND must be a child window of the specified parent."
Update: the colleague mentioned below was looking at the wrong machine. See also conversation with @Sam of Simple Samples - I would still be interested in knowing why this setting might be missing on some machines, but there is a lot less of an urgency about this now.
Hello there......
We have created an Outlook Add-in that we've used without problems for years. One of the things this Add-in does is show dialogs from which users can select files to either attach to an email they're composing or files attached to an incoming email they're processing with our Add-in.
As an added feature we allow the user to view the document.
Traditionally we have always used a WebBrowser control for this. The dialogs are WPF windows. We would convert each document to a HTML representation of same and then show that HTML document in the WebBrowser control.
Lately we have started getting occasional reports from users that this Preview is no longer working. The users are also reporting the appearance of "phantom" dialogs when hovering over the Outlook thumbnail in their task bar when this preview fails
The good news is that this can be addressed quite simply by setting an outlook setting. Go to File - Options and on the General tab there is a section "User Interface Options" and if you choose "Optimize for compatibility" there the problem goes away.
Great, right?
Until I asked my colleague who had the problem to do this. On his machine the options simply weren't there. I also looked at his registry, and while in my own registry the value RenderForMonitorDpi was present in HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Outlook\Options, in his registry that value was completely missing.
What's going on here and what could I do about it?