CefSharp for WPF rendering squished controls - wpf

I am using CefSharp in WPF application, running it from VisualStudio works fine, but when deployed, the controls are squished.
Am I missing some resource?
I am using version 73.1.130 from NuGet, installing on Windows 10 using msi installer created with Wix.

thanks to #amaitland I checked the included resources again and I found out, I missed the locales: locales*.pak - Localized strings for WebKit UI controls
turns out, they are quite important as the description says: Locales are conditionally required, features like context menus will show empty items without them. Fonts may show smaller than they should. The CEF documentation on the subject states: Without these files arbitrary Web components may display incorrectly.

Related

WPF unable to choose right DLL if several versions are loaded within same AppDomain

We are developing plugins to be added to a giant & awesome software. We often reuse the same WPF controls so we packaged them and created separate assemblies for each of them.
Sometimes, we need to load 2 different plugins within the same instance of the software. At that point, if the 2 plugins use the same reusable control but with different DLL versions, WPF doesn't seem to be able to choose the correct one. Both DLLs are correctly loaded (seen using Process Explorer).
What we already tried :
Binding redirects
Assembly redirects
Overridden assembly resolving
Is there any solution to indicate to WPF which version of the same DLL it needs to select for requested namespace in XAML ? Could we force the use of the latest in some way (this would work for us) ?
Look at my commit o SharpDevelop: https://github.com/icsharpcode/SharpDevelop/commit/b3ea4a0efb7e3b8e083f8be40ea6f7e03ff44604
I fixed this, by using a custom "InitializComponent" Call! ("SpecialInitializeComponent") and using special merged ResourceDictionarys: VersionedAssemblyResourceDictionary! Hope that helps you!

Gesture support for WPF WebBrowser Control which is displaying a HTML5 Site

In a standard WPF app, I have a WebBrowser control which has been navigated to a HTML5 sample page (http://ie.microsoft.com/testdrive/Browser/BrowserSurface/).
In the browser outside the app, I can interact with this site as expected – move photo’s around, use gestures etc.
In the WebBrowser control the site does not work as expected. It renders, but it does not respond to any touch gestures – It will, however, zoom in and out when I pinch.
Is it possible to make the WebBrowser control pass gesture events etc so that I can interact with the site as I would in a normal browser?
Many thanks for any help with this!
Kris
I know this is an old question but I think this has something to do with the fact that the WebBrowserControl standard uses IE7 ActiveX. I had the same problem which always gave me JavaScript errors in the control for TouchEvents.
After I added some registery key to force the WebBrowserControl to use the latest IE version installed it worked.
Here is what I've add to my registery. Paste it in a txt file and save it as an .reg file. Then DoubleClick it. Or enter the key/value manual in your registery via Regedit.
I even included this in my application code to add the key/value automaticially if it doesn't exist yet.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION]
"RetailTestApplication.exe"=dword:270f
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION]
"RetailTestApplication.exe"=dword:270f
Sorry, the code plugin srews up.
Change IE version for the WPF WebBrowserControl
MSDN Internet Feature Controls (B..C)

Codeplex sample browser - what UI technology is it?

Codeplex has a strange application for downloading and browsing Windows samples, and I have not been able to understand just what it is:
http://1code.codeplex.com/releases/view/64539
When the click-once application above is installed, it creates a single file in the form of a shortcut which contains the following line only:
http://1code.codeplex.com/releases/clickonce/SampleBrowser.application#SampleBrowser.application, Culture=neutral, PublicKeyToken=48e4844f2d49d017, processorArchitecture=msil
Then, when this shortcut is double-clicked, a sort of browser application comes up, but it has no window borders and is very modern looking. What type of technology is this? I am including the WPF tag otherwise I am at my wit's end as to what it is.
(Wanted to include an image of the said application here but can't seem to upload an image as I am getting the following error: "Failed to upload image; imgur is rejecting the request") Here's a link to that image: http://imgur.com/B38P6
Thanks.
The initial part about the odd link is simply a click-once application. The rest of the application is hidden away somewhere in your user directory.
The "browser" is simply a window which has had its chrome modified. Could be pretty much any technology. A couple examples in winForms and wpf.
As a caution, if doing a custom chrome in wpf don't use the AllowTransparency="True" if you want your comboboxes and such to work properly on XP.

Alternatives to WebBrowser control in WPF?

We are working on a WPF app with the web browser control. When the user drags the window, the web browser lags behind the window as it drags.
Does anyone know how to solve this issue? Failing that, does anyone know an alternative to the web browser control itself?
Thanks!
Yes, as long as you don't require IE specific features you can use Awesomium which basically gives the same browser engine used by Google Chrome except for everything is rendered in pure WPF. For a while it was open source but I believe it is becoming a commercial product.
I haven't heard about any Native WPF WebBrowser Control. The only options I know are based on Win32 controls which are wrapped into WPF controls in order to displayed. (See more details at http://msdn.microsoft.com/en-us/library/ms752055.aspx )
Recently I have to use the WPF wrapper for the WebBrowser control, and it's very limited regarding the options available for the developer. During my research I found that you are able to inject scripts or html content in order to modify the page behavior. Also, you can call .NET code (e.g. CSharp function from Javascript).
However tasks such as accessing the cache, modifying cookies are difficult task or changing the web browser behavior are very difficult. Here is when you will have to use DLL Imports in order to invoke unmanaged routines (see http://msdn.microsoft.com/en-us/library/aa984739(v=vs.71).aspx )
It's possible to look for an alternative WebBrowser control such as:
http://code.google.com/p/csexwb2/
http://wpfchromium.codeplex.com/
I hope this helps
You can try CefSharp.Wpf which uses Chromium as a base browser. You can find it on NuGet

Can I load more than one COMCTL32.dll into a process?

I'm developing an ActiveX control which (these days) is used mostly in WinForms apps.
The ActiveX control has a 'property page' dialog, which can be shown programmatically using the ShowPropertyPages method on the AxHost class. This is the custom UI that can be brought up in Visual Studio to edit a control's properties.
This property page dialog contains a ListBox control which uses an ImageList to display icons next to list items. These icons are 32-bit alpha-blended bitmaps. In order for these to display properly, version 6.0 or above of COMCTL32.DLL must be used.
Unfortunately when I run my WinForms app, it loads and uses COMCTL32.DLL version 5.xxx. As a result, when the property page dialog is displayed the icons look bad (the semi-transparent areas are drawn in solid black).
My question is: is there any way I can make sure to use COMCTL32.dll version 6.0+ from within the ActiveX control's property page UI, regardless of what the process is using? Or can I force the host process to use version 6.0? (I think not, because I am thinking the host process might have already loaded COMCTL32.DLL into memory before any of the code in the ActiveX control.
This webpage covers some scenarios for using COMCTL32 6.0, but not the situation I am in.
The original MSDN article was confusing me because it focussed on a number of specific scenarios, none of which matched mine. In fact, the underlying technology it is talking about works more generally.
By adding a 'manifest' xml file resource to the ActiveX DLL, I can signal to the side-by-side system that I want that DLL to use COMCTL32.DLL 6.x. That version is then loaded automatically. Pretty nice.
This manifest needs to be resource type RT_MANIFEST, with a resource ID of 2.
Here's the evidence of success (two versions of the same DLL loaded in the same process!):
(also, the icons display properly in the listbox ;))
If your application calls Application.EnableVisualStyles() (typically before calling Application.Run() to start a message loop) then version 6+ of the common controls library should be used.

Resources