博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
How to customise the TWebBrowser user interface (part 6 of 6)
阅读量:5256 次
发布时间:2019-06-14

本文共 2236 字,大约阅读时间需要 7 分钟。

Demo Code

Demo code to accompany this article is available for download (see below). The demo includes the following:

  • Two applications – WBUIArtDemo1.exe and WBUIArtDemo2.exe – that include Delphi code for stages 1 and 2 of the sample application.
  • Separate units containing the nul and custom container classes – UNulContainer.pas and UContainer.pas.
  • IntfDocHostUIHandler.pas that contains the declaration of IDocHostUIHandler, associated structures and all the DOCHOSTUIFLAG_ flags.

This code was written in Delphi 7 and tested on Windows XP Pro SP2 using Internet Explorer 6.

This source code is merely a proof of concept and is intended only to illustrate this article. It is not designed for use in its current form in finished applications. The code is provided on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. The source code is released under the same Creative Commons license as this article – see the bottom of this page for details. If you agree to all this then please download the code using the following link.

Summary

In this article we have investigated how to customize the appearance of a TWebBrowser control.

We noted that we can control the appearance and behaviour of TWebBrowser by developing a container object that implements the IDocHostUIHandler interface. In order for the browser control to find the IDocHostUIHandler implementation we also needed to implement IOleClientSite.

We first created a reusable, "do nothing" container class that provided a minimal implementation of the required interfaces. Then we derived a custom class from the "do nothing" container that provided the required customization. We also exposed properties to enable users to manipulate the browser's appearance and behaviour. Finally we developed a sample application to exercise the customizable container.

A downloadable demo program was made available that includes all the code discussed in the article.

References

The following resources from the Offsite icon were used in researching this article:

  • Offsite icon.
  • Offsite icon.
  • Offsite icon.
  • Offsite icon.

Feedback

I hope you enjoyed this article and found it useful. If you have any observations, comments or have found any errors please .

转载于:https://www.cnblogs.com/MaxWoods/archive/2008/10/15/1311453.html

你可能感兴趣的文章
设计模式课程 设计模式精讲 2-2 UML类图讲解
查看>>
Silverlight 的菜单控件。(不是 Toolkit的)
查看>>
jquery的contains方法
查看>>
linux后台运行和关闭SSH运行,查看后台任务
查看>>
桥接模式-Bridge(Java实现)
查看>>
303. Range Sum Query - Immutable
查看>>
C# Dynamic通用反序列化Json类型并遍历属性比较
查看>>
前台freemark获取后台的值
查看>>
Spring-hibernate整合
查看>>
exit和return的区别
查看>>
Django 相关
查看>>
Python(软件目录结构规范)
查看>>
codeforces水题100道 第二十二题 Codeforces Beta Round #89 (Div. 2) A. String Task (strings)
查看>>
c++||template
查看>>
条件断点 符号断点
查看>>
.net学习之继承、里氏替换原则LSP、虚方法、多态、抽象类、Equals方法、接口、装箱拆箱、字符串------(转)...
查看>>
python的多行注释
查看>>
连接Oracle需要jar包和javadoc文档的下载
查看>>
Dreamweaver cc新版本css单行显示
查看>>
【android】安卓的权限提示及版本相关
查看>>