zoukankan      html  css  js  c++  java
  • VC:CFindReplaceDialog(非模态对话框、IsWindow()、m_fr、GetFindString())

    1、新建:

           if(pdlg!=NULL&&::IsWindow(pdlg->m_hWnd))

                  pdlg->ShowWindow(SW_SHOW);

           else

           {

                  pdlg=new CFindReplaceDialog();

                  pdlg->m_fr.Flags=pdlg->m_fr.Flags|FR_MATCHCASE|FR_WHOLEWORD;

           }

           if(!::IsWindow(pdlg->m_hWnd))

           {

                  pdlg->Create(FALSE,"字符串","改变字符串");

                  pdlg->ShowWindow(SW_SHOW);

           }

    2、消息映射:

           1)

           //{{AFX_MSG(CDialogDlg)

           afx_msg long OnFindReplace(WPARAM wParam,LPARAM lParam);

           //}}AFX_MSG

           DECLARE_MESSAGE_MAP()

           2)

           BEGIN_MESSAGE_MAP(CDialogDlg, CDialog)

           //{{AFX_MSG_MAP(CDialogDlg)

          

           ON_REGISTERED_MESSAGE(WM_FINDREPLACE,OnFindReplace)

          

           //}}AFX_MSG_MAP

           //    

           END_MESSAGE_MAP()

    3、输出信息

                  CString message="";

                  if(pdlg->FindNext())

                  {

                  message+="查找下一个、\n\r";

                  }

                  message+="查找内容:";

                  message+=pdlg->GetFindString();

                  message+="\n\r";

                  message+="替换内容:";

                  message+=pdlg->GetReplaceString();

                  message+="\n\r";

                  AfxMessageBox(message);

                  return 0;

  • 相关阅读:
    根据之前发的那SQL语句查询表结构的语句做了个MSSQL实体类生成器!
    Struts1.1中的配置(转载)
    回首2011,展望My 2012
    Struts1中execute实现过滤控制
    接口通信的方式(上 )http方式
    创建表分区的总结
    mongodb系列一windowXP下的安装
    does not contain method named
    ORA12514 TNS: 监听程序当前无法识别连接描述符中请求的服务
    oracle9i卸载
  • 原文地址:https://www.cnblogs.com/shenchao/p/2737749.html
Copyright © 2011-2022 走看看