I am using Microsoft's Web Browser ActiveX control in an MFC application.
I want to be able to change the default MIME handler for PDF.
https://msdn.microsoft.com/en-us/library/ie/ms775148(v=vs.85).aspx
It appears to me that web browser control must use the registry based file type association
HKEY_CLASSES_ROOT\MIME\Database\Content Type\application/pdf
I want to be able to set web browser control to use the pdf application
I tell it to use at runtime, rather than using the system registered default.
I cannot find any API that will allow me to do this. Is it possible?
I initially proposed in the comments to create an Asynchronous Pluggable Protocol handler to customize the player for this MIME type, but I think there might be an easier approach.
You might be able to redirect the HKEY_CLASSES_ROOT\MIME\Database\Content Type\application/pdf registry key to your own custom version (per-process) with RegOverridePredefKey API, as explained here.
Related
The publish_actions permission is deprecated. This permission was very good for implementing Check-in via the place parameter. In the place parameter it was possible to put the Page ID and the Check in to be registered in the Page and also in the User Timeline.
Now we only have the option of Sharing Dialog which is very limited. I have not yet found any solution so that users can check in via Dialog Sharing. I want to implement this function in a custom Wi-Fi Hotspot. Does anyone have a solution?
Video example: https://wificem.com.br/video/hotspot-checkin.mp4
My C++ application is using a web browser (IE) control. I need to detect when the user clicks a button on a specific web page (using the element ID of that button).
How can I do this? I already have an event sink implemented, but I do not know how to catch mouse click on DOM elements.
The event you are looking for is probably related to:
onclick event
But whether this is accessible from the MS IE API from C++ via EventSinks, I don't know.
Other Round-About Way to Get Click Information to Your C++ Code
I am not an expert on it, but companies like UserZoom, analyze the information by inserting Javascript via a plug-in to the web browser. Here is a quote from their FAQ of how they collect the click-streams:
UserZoom FAQ
Data Collection & Tracking
What type of information is UserZoom
capable of tracking during the tasks?
With the plug-in version or non plug-in with JavaScript tracking code,
UserZoom can track participants’ navigation paths as well as where
participants have clicked on pages throughout the tasks (heatmaps).
With the non plug-in version, navigation paths and participant clicks
cannot be captured.
Now with this knowledge, go find a javascript library that can get the clicks and the document object model info.
Google Search: "how to get where the user clicked element in javascript"
How to get the target element when clicked?
StackOverflow: JavaScript: Get clicked element
Then you need to insert that bit of javascript into the webpages into the browser the user is using.
Adding Javascript with an add-on/extension/plugin in Firefox and Chrome is relatively easy, I've heard, but for IE, I think you have your work cut out for you to create the add-on in IE. After much searching I found this:
Inject HTML and JavaScript into an existing page with BHO using MS Visual Studio 2010 and C#
And lastly, get that information out of the javascript and into your code using JSON or AJAX and setting up a local webserver to receive it:
Google Search: receive ajax c++
Jquery Ajax Calling Functions
AJAX and the C++ Programmer
Hopefully that information gives you a starting point. Good luck.
I want to open/start my application when a I click on a particular URL from the browser for
Symbian OS Series60 5th edition.(So, if I click on a "station" Url, it will start my application & play through my player)
Any possible way that I can get it to do this?
I won't offer any guarantee that you can do this on your own.
I suggest you start by reading the documentation for the Nokia Content Handling Framework.
However, there is a difference between the Operating System understanding that a specific MIME type should be handled by a specific application and the Web Browser actually allowing that to happen.
Several Web browser can be installed on a Series60 5th edition handset. I'll assume you are only interested in the default Webkit-based web browser already included in the phone but you need to be aware that it may not be the one the phone owner will ultimately use on a regular basis. Opera Mini is very popular and it certainly won't allow you to do what you want here.
Even with the default Webkit web browser, it is very possible that you won't be able to do what you want without at least some support from the handset manufacturer since you rely on either:
The Symbian Content Handling Framework being able to consider the scheme of a URL (instead of just a MIME type) as a content identifier and the Web Browser being fully integrated with the Content Handling Framework
or the Web Browser allowing you to write a plugin that makes it able to understand what is basically a new URL scheme (a URL not beginning with "http://"), display it as a hyperlink (you might just get that right now on your phone without doing any work. it's worth a try.) and behave the way you want when the user activates the hyperlink.
There is one alternative worth attempting: Keep the "http://" URL scheme but make sure your web server returns your own MIME type in the HTPP headers when it receives a HTTP GET request for the data.
Obviously, you will need your application installed on the handset and able to handle that MIME type.
You have a better chance of the default Web Browser being sufficiently integrated with the operating system already for this to work.
I can enable the management of content types in a document library's "advanced settings". Is there any web service method for this? I need to do this in an automated way, not manually.
It seems like neither Lists.AddList nor Lists.UpdateList can set the value of the "Flags" attribute that is needed for this. My web service client has alread created a new content type and has associated this content type with the list. But without enabling the management of content types, the new type won't appear in the "New" drop-down menu, for example.
Niklas
The web services are limited compared to what is available using the object model. If you can't find it in the web services SDK (I can't) then unfortunately it doesn't exist.
If you can use the object model, see SPList.ContentTypesEnabled. Otherwise, you will need to create your own web service that flips the bit on this particular property.
How can I launch a URL in a NEW window using C++ (Windows only)?
The straight-forward approach seems to open a new tab in an existing browser window. (Or, if tabbed browsing is disabled, the new URL hijacks the existing browser window).
This is for a (large) desktop app, using MFC and Qt.
I've used this for showing locally generated html in the default browser, in my case filename is something like "c:\temp\page.html", perhaps replacing filename with the URL might work??
ShellExecute(NULL,"open",filename,NULL,NULL,SW_SHOWNORMAL);
Updated:
http://support.microsoft.com/kb/224816
How ShellExecute Determines Whether to Start a New Instance
When ShellExecute looks through the registry, it looks for the shell\open subkey. If the shell\open\ddeexec key is defined, then a Dynamic Data Exchange (DDE) message with the specified application IExplore and the topic WWW_OpenURL is broadcast to all top-level windows on the desktop. The first application to respond to this message is the application that goes to the requested URL. If no application responds to this DDE message, then ShellExecute uses the information that is contained in the shell\open\command subkey to start the application. It then re-broadcasts the DDE message to go to the requested URL.
So it looks like you have no control over opening a new window. Whatever browser currently running can handle opening it in whatever way they want.
This is controlled by windows. The only way to explicitly tell it to open in a new browser window is to spawn the browser explicitly and give it the url.
Here's a link to some code that will open a URL in a new browser. The code looks up the default application for handling an HTML document and then explicitly opens that application with a ShellExecute call.
You can't in general. The user's browser is free to do whatever the user wants it to do.
One way to achieve your desired effect might be to embed a particular browser in a window of your own (say, the IE ActiveX control) and have that render your URL.