zoukankan      html  css  js  c++  java
  • 10)添加路径并显示

    1)还是接着(9)的代码

    2)  步骤:

            

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

            

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

            

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`

          同时 点击那三个按键    然后就会蹦到  这三个按键绑定的函数那里

    --------------------------------------------------------------------------------------------------------------------

            

     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

          这三个函数代码,

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

            

     1 void Cshow::OnBnClickedDel()
     2 {
     3     // TODO: 在此添加控件通知处理程序代码
     4     for(int i=0;i<clist.GetItemCount();i++)
     5     {
     6         if(clist.GetCheck(i)==TRUE)
     7         {
     8             clist.DeleteItem(i);
     9             i--;
    10         }
    11     }
    12 }
    13 void Cshow::OnBnClickedCul()
    14 {
    15     // TODO: 在此添加控件通知处理程序代码
    16     clist.DeleteAllItems();
    17 }
    18 void Cshow::OnBnClickedAdd()
    19 {
    20     // TODO: 在此添加控件通知处理程序代码
    21     CString st=Cxiang_01App::showBrowse(this);
    22     if(st!=L"")
    23     {
    24         clist.InsertItem(clist.GetItemCount(),st);
    25     }
    26     
    27 }

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~·

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

              

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

              

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

              

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

              前面补充:
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

              

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

              

     1 CString Cxiang_01App::showBrowse(CWnd * pcWnd)
     2 {
     3     BROWSEINFO  info;
     4     wchar_t str[MAX_PATH]={0};
     5     wchar_t str1[MAX_PATH]={0};
     6     info.hwndOwner=pcWnd->m_hWnd;
     7     info.pidlRoot=NULL;
     8     info.pszDisplayName=str;
     9     info.lpszTitle=L"请选择一个吧";
    10     info.ulFlags=BIF_EDITBOX;
    11     info.lpfn=0;
    12     info.lParam=0;
    13     info.iImage=0;
    14 
    15     PCIDLIST_ABSOLUTE pid=::SHBrowseForFolder(&info);
    16     if(pid!=NULL)
    17     {
    18         if(::SHGetPathFromIDList(pid,str1)==TRUE)
    19         {
    20             return str1;
    21         }
    22     }
    23     
    24     return L"";
    25 }

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

            结果展示:

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

              

  • 相关阅读:
    How to run a batch file each time the computer loads Windows
    go.mod file not found in current directory or any parent directory; see 'go help modules'
    xshell 所选的用户密钥未在远程主机上注册;无法加载密钥
    群起Hadoop的一个错误
    ssh: connect to host hadoop102 port 22: No route to host
    VMware下centos7配置静态ip并解决ping不通百度的问题
    虚拟机CentOS 7 网络连接显示"以太网(ens33,被拔出)"
    Rust-线程:使用消息传递在线程间传送数据
    Rust-线程,使用线程同时运行代码
    Rust-智能指针:RefCell<T>和内部可变性模式
  • 原文地址:https://www.cnblogs.com/xiaoyoucai/p/8350103.html
Copyright © 2011-2022 走看看