i suggest you take a look at many articles here in CP by people who mamanged to intercept javascrip or url click inside HTML doc displayed through CHTMLView. Thus you will be able to code whatsoever application or action you may want to execute via the C++ code. Good luck.
Our Philosophy, Mohammed Baqir Al Sadr