CListCtrl With Web Links

源代码及可执行文件下载地址:http://files.cnblogs.com/rainboy2010/ListCtrlLinkTest.zip

CListCtrlLink是CListCtrl的扩展类,可以在ListCtrl控件中包含网页链接

使用方法:

1. 添加ListCtrlLink.h,ListCtrlLink.cpp,LinkItem.h,LinkItem.cpp文件到你的项目工程中

2. 添加ListCtrl控件,并和相应的CListCtrlLink变量关联

CListCtrlLink    m_listCtrl;

3. 在OnInitDialog()中添加以下代码:

m_listCtrl.InsertColumn(0, _T("Name"), LVCFMT_LEFT, 60);
m_listCtrl.InsertColumn(1, _T("Age"), LVCFMT_LEFT, 60);
m_listCtrl.InsertColumn(2, _T("Company"), LVCFMT_LEFT, 100);
m_listCtrl.InsertColumn(3, _T("Email"), LVCFMT_LEFT, 200);

m_listCtrl.InsertItem( 0, _T("Ana"));
m_listCtrl.SetItemText(0, 1, _T("26"));
m_listCtrl.SetItemText(0, 2, _T("Stanford"), _T("http://www.stanford.edu"));
m_listCtrl.SetItemText(0, 3, _T("Unpublished"));
m_listCtrl.InsertItem( 1, _T("John"));
m_listCtrl.SetItemText(1, 1, _T("21"));
m_listCtrl.SetItemText(1, 2, _T("Yahoo"), _T("http://www.yahoo.com"));
m_listCtrl.SetItemText(1, 3, _T("[email protected]"), _T("mailto:[email protected]"));

m_listCtrl.InsertItem( 2, _T("Cassio"));
m_listCtrl.SetItemText(2, 1, _T("29"));
m_listCtrl.SetItemText(2, 2, _T("Symantec"), _T("http://www.symantec.com"));
m_listCtrl.SetItemText(2, 3, _T("[email protected]_email.org"), _T("mailto:[email protected]_email.org"));

m_listCtrl.InsertItem( 3, _T("Peter"));
m_listCtrl.SetItemText(3, 1, _T("64"));
m_listCtrl.SetItemText(3, 2, _T("Retired"));
m_listCtrl.SetItemText(3, 3, _T("[email protected]_man.org"), _T("mailto:[email protected]_man.org"));

SetItemText的原型为: BOOL SetItemText(int nItem, int nSubItem, LPCTSTR lpszText, LPCTSTR lpctszUrl = NULL),

如果lpctszUrl不设置值,则不会显示超链接,如设置值,则对应的列显示为超链接,点击超链接,会执行ShellExecute API调用 

时间: 2024-08-25 19:41:35

CListCtrl With Web Links的相关文章

【转】深入浅出PageRank算法

原文链接 http://segmentfault.com/a/1190000000711128 PageRank算法 PageRank算法是谷歌曾经独步天下的“倚天剑”,该算法由Larry Page和Sergey Brin在斯坦福大学读研时发明的, 论文点击下载: The PageRank Citation Ranking: Bringing Order to the Web. 本文首先通过一些参考文献引出问题,然后给出了PageRank的几种实现算法, 最后将其推广至在MapReduce框架下

6 Useful Databases to Dig for Data (and 100 more)

6 Useful Databases to Dig for Data (and 100 more) You already know that data is the bread and butter of reports and presentations. Data makes your presentation solid. It backs up the ideas you are selling. It gives people reasons to listen to you. Ho

Propagation of Visual Entity Properties Under Bandwidth Constraints

1. Introduction The Saga of Ryzom is a persistent massively-multiplayer online game (MMORPG) released in September 2004 throughout Europe and North America, localised in 3 languages so far. It has been developed by Nevrax since 2000, and was taken ov

数据卷及容器连接

应用在容器中运行,总会用到或者产生一些数据,那么这些数据是如何保存的呢?外部又是如何使用这些数据的呢? 容器网络基础:容器通过对外暴露端口向外提供服务数据卷的概念和使用:通过数据卷来存储和共享数据容器连接:通过互联让一个容器安全的使用另一个容器已有的服务 当Docker启动后,会在宿主主机上创建一个名为docker0的虚拟网络接口:[[email protected] ~]# ip address show1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdis

docker-compose编写(英文)

原文地址:https://docker.github.io/compose/compose-file/ Compose file reference The Compose file is a YAML file defining services, networks and volumes. The default path for a Compose file is./docker-compose.yml. A service definition contains configuratio

Web_crawler

link(http://en.wikipedia.org/wiki/Web_crawler) Web crawler Not to be confused with offline reader. For the search engine of the same name, see WebCrawler. A Web crawler is an Internet bot that systematically browses the World Wide Web, typically for

Docker Compose文件详解 V2

Compose file reference 语法: web: build: ./web ports: - "5000:5000" volumes: - .:/code links: - redis redis: image:redis build:可使用相对目录或绝对目录 ports:可使用端口范围 links:可使用别名,例如: -redis:web-redis build build: ./dir # build后可直接接Dockerfile所在目录,该目录必须存在Dockerf

如何使用 Docker 组件开发 Django 项目?

Docker 是一个开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可移植的容器中,然后发布到任何流行的 Linux 机器上,也可以实现虚拟化.自2013年发布以来,无论是从 Github 上的代码活跃度,还是 Redhat 在 RHEL6.5 中集成对 Docker 的支持, 就连 Google 的 Compute Engine 也支持 Docker 在其之上运行.火热程度可见一斑! 本篇文章详细介绍了如何通过 Docker Machine 「系统配置」和 Docker Comp

微软将支持.net开源并跨平台,新特性会体现于VS2015

http://news.microsoft.com/2014/11/12/microsoft-takes-net-open-source-and-cross-platform-adds-new-development-capabilities-with-visual-studio-2015-net-2015-and-visual-studio-online/ Microsoft takes .NET open source and cross-platform, adds new develop