C++ WebView control in Windows Phone 8? - windows-phone

Is there a web browser or web view control available to Windows Phone 8 applications written in C++? I've found a WebBrowser control but that seems to be only available in Windows Phone 7 written in C#.

There's no way to directly use a WebBrowser control in C++. You'll have to create a mixed C++ and XAML projects and overlay the on top of your DirectX .
Note, using Hybrid XAML & D3D apps has a small performance hit over using pure C++ D3D apps. Even if you never show any XAML, just initializing the full CLR and loading up XAML for is still pretty heavy. Read more about it on MSDN here and here.
On other thing that might be applicable to you is that the WebBrowserTask has been ported over to WinRT so it's accessible from C++. Alongside with the Launcher.LaunchUriAsync() method it allows you to navigate away from your app and open up IE10 to a specific page.

Related

Get Window handle in Windows store app

I am working on a app which needs to have a custom camera capture dialog to enable zoom, flash etc. which default CameraCaptureUI does not have. My app will be deployed on tablets and I have a .NET SDK (provided by tablet vendor) which I can use to enable zoom, flash and every other thing. The SDK is not compatible with windows store app and it uses Win32 api but I can still use some of it functions.
So this SDK have a preview method which requires window handle (InPtr) to start a preview. The problem is I cant find window handle for a store app window or rather I don't know how to find it. If i can find it somehow I am sure I will be able to implement other features easily enough.
Can someone show me how to find window handle in Windows store app?
Thanks a lot for any pointers!
According to this post: http://tinyurl.com/pf5kpyv you can find the window handle of a store app using the Win32 API. But if your target is WinRT, you won't have the Win32 API available (probably you already know this). If your target is full Windows 8.1, it might be easier to just write it as a non-store app. Of course, if your client requires it to be "modern" than you're stuck :)

Can we access Windows 8 WinRT API from desktop application and Windows Phone 8 app? If so, are they in different namespaces?

Over the course of time I received a number of comments on my blog in this area. Many questions were asked like “Can you use WinRT from Desktop applications?”, “Can you use WinRT from .NET applications?”, “Can you use WinRT from .NET applications?” etc? If so, how?
Yes, you can and for more information refer to http://kishore1021.wordpress.com/2012/08/14/can-you-use-windows-8-winrt-api-from-net-desktop-applications/
Coming to architecting such applications, the best way to go forward is to develop a Portable Class Library and access the API's that can be used from Desktop, Store and Phone apps. By this kind of design, you don't rewrite the business logic code for each device. For detailed information on PCL, see http://channel9.msdn.com/Shows/This+Week+On+Channel+9/TWC9-August-10-2012
The subset of the Win32 and COM API that can be used in a Metro style app is indicated in the header files in the Windows Software Development Kit (SDK) for Metro style Apps. Look for the following statements in the header files:
#pragma region Application Family
#pragma region Desktop Family
More of that sort:
From CodeProject
From Intel Developer Zone

windows phone activex

We have created a C# windows form application that uses an ActiveX control to display video stream. Now we are planning to develop the same application in windows phone.
Is it possible to use ActiveX controls (OCX Files) in windows phone development?
No its not. You can only use Silverlight and XNA on Windows Phone.
You already have a Media content available using Silverlight that you can use to stream Video. You can find more information here:
http://msdn.microsoft.com/en-us/library/ff426928(v=VS.95).aspx
It can get as simple as something like this:

Reference Silverlight 4 control from Silverlight 3

Short Question:
If I have a Silverlight application built in SL3 can I detect at runtime if the client is using SL4 and use the Cursors.NESW that is only available in SL4?
More Info:
I have a Silverlight application built using Silverlight 3. I'd like to display a cursor Cursors.SizeNESW in my application. The way I was doing it was to set the Cursor to Cursors.None and display a NESW image in place of the cursor.
However, on Safari on a Mac this causes an issue - Silverlight is running in windowless mode, and if I put an iframe that covers the silverlight app and the cursor is set to none in the silverlight app - then mousing over the iframe will cause the cursor to disappear. I suspect my image cursor is being displayed in the Silverlight underneath the iframe.
Due to business reasons, upgrading to Silverlight 4 for the PC version probably won't happen soon. However, we've had to require Silverlight 4 on the Mac anyway to fix this issue.
I don't think it is possible to mix versions. A project is compiled either SL3 OR SL4. You'd have to have two different versions of your application.
This question has information on detecting a client's runtime version of Silverlight:
Version detection with Silverlight

Suggestions on including the web browser control in VB.Net desktop application

I am writing a desktop app in VB.Net, and I'd like to include a web browser control to automate certain functions the user might have to perform in the browser. I have to render the page so I do not want to use the webrequest to make direct calls. When I publish the app, do I have to be concerned with which version of Internet Explorer the user has on their machine? Are their any third party, freely available, stable web browser controls available for VB.Net that people are using?
You could always ignore the whole IE issue and use the Mozilla engine embedded in your app:
geckofx
"An open-source component for
embedding Mozilla Gecko (Firefox) in
.NET applications."
http://code.google.com/p/geckofx/
Several versions of Visual Studio support web browser controls. Here is an article on how to implement one.
http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.aspx
The web browser control will work with different versions of Internet Explorer, but will be limited to the functionality supported by that version of Internet Explorer.
The article is based on Visual Studio 2008, but in the right corner of the article there are links, on how to use the web browser control, to earlier versions of Visual Studio.
If you embed the Webbrowser control in your application, what you're really doing is embedding a COM object. At runtime, your app will CoCreateInstance() the Webbrowser control, which will load it out of the version of SHDOCVW.DLL or IEFRAME.DLL that is currently on the machine. So, in plain English, you'll be getting the IE6, IE7 or IE8 Webbrowser control, depending on what is installed on the machine.
The practical differences, however, are minimal since the interfaces were published a long time ago and haven't changed over those versions. Differences in terms of different commands that some interfaces (such as IOleCommandTarget) support are abstracted away by the managed layer anyway, so you don't have to worry about that. The biggest difference will be rendering differences, since there is a huge delta in CSS conformance between IE6 and IE8. You'll have to test the various versions using Microsoft's app compat VHDs.
When I worked on the IE team application compatability wrt the Webbrowser control was a huge deal; the team works very hard to make sure that behavior doesn't regress for precisely this scenario—the custom enterprise VB app hosting the WebOC.
Though if you decide to go with an open-source solution to distribute with your app, may I suggest WebKit? Its layout engine is very good and the source code is pretty well maintained and easy to read, though you'll have to write your own managed hosting layer. The Gecko code is much harder to read and debug.