How to read page source TWebBrowser Firemonkey - delphi

How can I read source of the open page in TWebBrowser in firemonkey (RadStudio XE7 - Firemonkey for Android)
In VCL I simply used WebBrowser1.document but in firemonkey it has an error
TWebBrowser does not contain a member named document
How can I fix that?

The sad answer is that you can't access the source code of a webpage directly from the TWebBrowser. You can't access it because the TWebBrowser in FireMonkey is cross-platform and that means it must work on all platforms. Android and iOS does not support and allow this, which means the Windows Desktop version of TWebBrowser can't allow this either.
You will have to use a different component to do this, probably a third party component.
I am not sure if this will help you or not, but here is a link to something that might help: http://firemonkeylessons.blogspot.tw/2015/01/get-htmljson-from-twebbrowser.html

Related

WebBrowser : VCL to FMX [duplicate]

I'm trying to create an Android (multi-device) application with Delphi 10.2 that uses TWebBrowser. I load a URL and I want to parse its contents for fields, but I don't know how do it.
I read this excellent guide: http://www.cryer.co.uk/brian/delphi/twebbrowser/twebbrowser_oleobject.htm#OleObject.Document, but the property WebBrowser.OleObject.Document doesn't exist.
Can somebody help me, please?
The TWebBrowser for FMX is completely different from TWebBrowser for VCL. The VCL one makes use (for access to the Document, etc) of interfaces provided by Internet Explorer, or rather the DLLs on which it is based. IE only runs on Windows, so you shouldn't be surprised to learn that the interfaces it provides are not available on FMX.
The FMX TWebBrowser is a completely different and far more limited beast. It is not automatable in the same way TWebBrowser for VCL/Windows is, and some would say that is a good thing.

Create Chromium's WebView and place it on a Form?

Since turns out the current WebBrowser for Android offering not sufficient for my project properties - I need to create a native instance of Chromium WebView and place it on my Delphi's forms, yet I am unable to find anything similar as an example.
How to create a native Chromium's WebView and place it on my Delphi's Forms ?
If you want to do it all by yourself – it’s a lot of work. Better to use free components to do it. You can check https://github.com/salvadordf/CEF4Delphi project. There are a lot of demo and you can choose the best way to solve your task. There is VCL version for Windows and FMX version for multiplatform.

Using FMX forms in a VCL application in XE7?

Even though it is not officially supported by Embarcadero there are many examples showing that you can include a FMX form in a VCL application e.g. MonkeyMixer and this SO question.
However, when I create a test application with only one empty VCL form and one empty FMX form, I get two problems:
There are two application icons in the task bar (apparently one for
each instance of TApplication i.e. VCL and FMX)
It crashes when I close the application (when it calls TStyleManager.UnInitialize in FMX.Forms.FinalizeForms).
How can I make this work?
I need this combination as we want our application to be native on Windows, Mac OS and iOS. Therefore on Windows it is a VCL application and the other OS's are FMX using the TMS native components. We have some large custom graphical components that are made for FMX, and they must also work on Windows.
Edit:
I see only two alternative solutions, and I like none of them:
Use FMX on Windows too. I don't like the idea of styled components instead of native. Experienced users can easily tell the difference.
Maintain to sets of our custom components: VCL and FMX editions. That will require some work, and also the graphical features of FMX are much better than VCL.
I've needed to host an FMX app inside a VCL app for display and training purposes. The FMX app is really an Android target and the VCL a Windows 'demonstrator'. The FMX hosting is done using TFireMonkeyContainer hosting the FMX main form. Yes it's got slight wrinkles but it works ok and I'm sure we'll find a way to improve things.
My FMX main form is created at runtime and has visibility of only FMX.Forms. It is then passed to TFireMonkeyContainer and is destroyed by it when the VCL app closes.

Windows 8 Message Window

Windows 8 has a new message window that displays in the top right side of the screen. Does Delphi XE4 have any API to access this new feature?
This kind of dialog is part of the Windows.UI.Notifications namespace which belongs to the WinRT, and unfortunately you cannot access the WinRT from Delphi directly. but maybe you can try this article to check a sample with experimental access to the WinRT from Delphi, Writing Hello World for WinRT in Delphi
This is Notifications or Toasts, you can find a C++ and C# example here - http://code.msdn.microsoft.com/windowsdesktop/Sending-toast-notifications-71e230a2
I've yet to see a direct Delphi implementation of this which is why I can only suggest the C++/C# version.

Pegasus Imaging PrintPro ActiveX control gives error when dropped on Delphi form

I'm trying to use the Pegasus Imaging PrintPro v4 ActiveX control with Delphi 7 on a Win2K box. When I drop the ActiveX control on the form I get the extremely helpful error message
"Access violation at address 00000000. Read of address 00000000."
and the component doesn't appear on the form.
There are a bunch of other Pegasus Imaging ActiveX controls installed and they work fine.
Any suggestions on where to start troubleshooting, I'm not very experienced with ActiveX control (I usually go for native VCL only).
Lachlan
If you download the latest changes file it says that "Fixed an issue where the ActiveX DLL would not register on Windows 2000.".
You should try upgrading to the latest version.
Something in the control is not configured properly. You might not be able to "drop" it on the form, but might have to instantiate it manually. The access violation you are experiencing is the attempt to get the value out of a pointer which is null. Most likely the control has a required construction parameter which is not being set by the Delphi ActiveX component wrapper.

Resources