做一个任意多文件(夹)压缩的程序,需要帮助:
有没有现存的对话框类可以同时选择文件和文件夹.
从网上搜了一下发现要么只能选择文件要么只能选择文件夹,希望能找到能同时多选文件和文件夹的类自己写一个要花一些时间,但我时间有限,希望有现存代码(或知道哪里有)的同志能帮帮忙.实在没有的帮我出出主意也好的.实在连主意也没有的,帮我顶顶也好的.

解决方案 »

  1.   

    There is a TVS_CHECKBOXES style for the TreeView control . However, it only gives you on/off check states (not grey). It's not hard to do yourself. 1) Create an image list with your check states 
    2) Assign it to TreeView->StateImages 
    3) Use OnMouseDown, GetHitTestInfoAt and GetNodeAt to handle the clicking on the checkbox. 
    4) Probably toggle state on VK_SPACE in OnKeyDown as well. 
    One tricky bit is that you will need to handle the 'when to grey' logic yourself. One rule might be, "if the user changes the state of a node, then all it's ancestors become grey." The other tricky bit is that you'll need to store the selection info in some sort of database or list. To optimize speed, you should only check nodes as they become visible (don't populate the whole tree just to set the check states!). Hook onto the OnExpanded event, then for each child node of the newly expanded node look up your list to determine the check state. 
    See also
    http://www.codeproject.com/treectrl/CFolderTreeCtrl.asp
      

  2.   

    或者使用SHBrowseForFolder,记着ulFlags|=BROWSEINCLUDEFILES;
      

  3.   

    I hope it like CFileDialog ,but not a tree
      

  4.   

    加入shell菜单里面,省去了对话框。
    实在不行只有自己做一个了
      

  5.   

    有的。OFFICE中有一些对话框满足这个要求的
    比如FrontPage中,编辑完网页,要求保存图片到本地的对话框