CFindReplaceDialog学习
The CFindReplaceDialog class allows you to implement standard string Find/Replace dialog boxes in your application. Unlike the other Windows common dialog boxes, CFindReplaceDialog objects are modeless, allowing users to interact with other windows while they are on screen. There are two kinds of CFindReplaceDialog objects: Find dialog boxes and Find/Replace dialog boxes. Although the dialog boxes allow the user to input search and search/replace strings, they do not perform any of the searching or replacing functions. You must add these to the application.
To construct a CFindReplaceDialog object, use the provided constructor (which has no arguments). Since this is a modeless dialog box, allocate the object on the heap using the new operator, rather than on the stack.
Once a CFindReplaceDialog object has been constructed, you must call the Create member function to create and display the dialog box.
Use the m_fr structure to initialize the dialog box before calling Create. The m_fr structure is of type FINDREPLACE. For more information on this structure, see the Win32 SDK documentation.
In order for the parent window to be notified of find/replace requests, you must use the Windows RegisterWindowMessage function and use the ON_REGISTERED_MESSAGE message-map macro in your frame window that handles this registered message. You can call any of the member functions listed in the “Operations” section of the CFindReplaceDialog Class Members table from the frame window’s callback function.
You can determine whether the user has decided to terminate the dialog box with the IsTerminating member function.
CFindReplaceDialog relies on the COMMDLG.DLL file that ships with Windows versions 3.1 and later.
To customize the dialog box, derive a class from CFindReplaceDialog, provide a custom dialog template, and add a message map to process the notification messages from the extended controls. Any unprocessed messages should be passed to the base class.
Customizing the hook function is not required.
/*
第一个参数为true显示的是查找对话框,为False时显示的是查找和替换对话框
第二个参数指定在查找对话框中显示的字符串
第三个参数指定在替换对话框中显示的字符串
第四个参数为指定标志位,用来定制对话框,其中FR_DOWM表示对话框中的“向下”单选按钮被选中,否则“向上”单选按钮被选中,具体可取值参考MSDN
第五个参数为指向父窗口的指针,如果为NULL,则为主框架窗口,使用时需要让它指向接收查找和替换消息的窗口
*/
void CMfcFindReplaceDlgDlg::OnBtnF()
{
CFindReplaceDialog* pFRDlg = new CFindReplaceDialog(); // Must be created on the heap
pFRDlg->Create( TRUE, "", "", FR_DOWN, this );
} void CMfcFindReplaceDlgDlg::OnBtnFr()
{
CFindReplaceDialog* pFRDlg = new CFindReplaceDialog(); // Must be created on the heap
pFRDlg->Create( FALSE, "", "", FR_DOWN, this );
}

CFindReplaceDialog学习的更多相关文章
- 从直播编程到直播教育:LiveEdu.tv开启多元化的在线学习直播时代
2015年9月,一个叫Livecoding.tv的网站在互联网上引起了编程界的注意.缘于Pingwest品玩的一位编辑在上网时无意中发现了这个网站,并写了一篇文章<一个比直播睡觉更奇怪的网站:直 ...
- Angular2学习笔记(1)
Angular2学习笔记(1) 1. 写在前面 之前基于Electron写过一个Markdown编辑器.就其功能而言,主要功能已经实现,一些小的不影响使用的功能由于时间关系还没有完成:但就代码而言,之 ...
- ABP入门系列(1)——学习Abp框架之实操演练
作为.Net工地搬砖长工一名,一直致力于挖坑(Bug)填坑(Debug),但技术却不见长进.也曾热情于新技术的学习,憧憬过成为技术大拿.从前端到后端,从bootstrap到javascript,从py ...
- 消息队列——RabbitMQ学习笔记
消息队列--RabbitMQ学习笔记 1. 写在前面 昨天简单学习了一个消息队列项目--RabbitMQ,今天趁热打铁,将学到的东西记录下来. 学习的资料主要是官网给出的6个基本的消息发送/接收模型, ...
- js学习笔记:webpack基础入门(一)
之前听说过webpack,今天想正式的接触一下,先跟着webpack的官方用户指南走: 在这里有: 如何安装webpack 如何使用webpack 如何使用loader 如何使用webpack的开发者 ...
- Unity3d学习 制作地形
这周学习了如何在unity中制作地形,就是在一个Terrain的对象上盖几座小山,在山底种几棵树,那就讲一下如何完成上述内容. 1.在新键得项目的游戏的Hierarchy目录中新键一个Terrain对 ...
- 《Django By Example》第四章 中文 翻译 (个人学习,渣翻)
书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:祝大家新年快乐,这次带来<D ...
- 菜鸟Python学习笔记第一天:关于一些函数库的使用
2017年1月3日 星期二 大一学习一门新的计算机语言真的很难,有时候连函数拼写出错查错都能查半天,没办法,谁让我英语太渣. 关于计算机语言的学习我想还是从C语言学习开始为好,Python有很多语言的 ...
- 多线程爬坑之路-学习多线程需要来了解哪些东西?(concurrent并发包的数据结构和线程池,Locks锁,Atomic原子类)
前言:刚学习了一段机器学习,最近需要重构一个java项目,又赶过来看java.大多是线程代码,没办法,那时候总觉得多线程是个很难的部分很少用到,所以一直没下决定去啃,那些年留下的坑,总是得自己跳进去填 ...
随机推荐
- 初识Kafka:构架、生产消费模型以及其他相关概念
当前使用的事件总线采用的是Kafka分布式消息队列来完成的,近来项目需要接入到事件总线中,故开启了kafka的学习之旅(之前一直在听说kafka这玩意儿,但是学习计划中还没有将它安排进去,借着这个机会 ...
- Spark createDirectStream 维护 Kafka offset(Scala)
createDirectStream方式需要自己维护offset,使程序可以实现中断后从中断处继续消费数据. KafkaManager.scala import kafka.common.TopicA ...
- MongoDB mongoimport 报错:lost connection to server
MongoDB对单次处理有大小限制,所以导入大文件会出问题. mongoimport 默认10000条 为一批导入,但如果单条数据过大,就会导致单次处理数据超过大小限制. 参数 --batchSize ...
- spring利用后置处理器初始化bean属性
spring利用后置处理器初始化bean属性 参考:http://blog.csdn.net/heyutao007/article/details/50326793 @Configurable @En ...
- JSP页面的基本结构 及声明变量
一.JSP页面的基本结构 在传统的HTML页面文件里增加Java程序片和JSP标签就构成了一个JSP页面文件. 一个JSP页面可由5种元素组合而成: 1.普通的HTML标记符 2.Jsp标签.如指令标 ...
- HDU 2191悼念512汶川大地震遇难同胞——珍惜如今,感恩生活(多重背包)
HDU 2191悼念512汶川大地震遇难同胞--珍惜如今.感恩生活(多重背包) http://acm.hdu.edu.cn/showproblem.php?pid=2191 题意: 如果你有资金n元, ...
- LoadRunner测试WebService的3种方式
LR在WebService虚拟用户协议中支持两种方式测试WebService,一种是通过“Add Service Call”的方式,一种是Import SOAP的方式. Import SOAP的方式需 ...
- 微信小程序页面跳转
一:跳转的数据传递 例如:wxml中写了一个函数跳转: [html] view plain copy <view class="itemWeight" catchtap=&q ...
- 基于windows api实现的共享锁/独占锁
众所周知,windows平台上实现线程同步.或者说资源的加锁与解锁的方法有内核事件.临界区.相互排斥量.信号量,甚至interlocked系列函数等多种手段. 可是在日常的编程中,我们使用这些手段对 ...
- CEF与JavaScript交互读取电脑信息
CefSharp中c#和JavaScript交互读取电脑信息 介绍 CEF是由Marshall Greenblatt于2008年创建的基于Google Chromium的BSD许可开源项目.与主要关注 ...