想做一个树控件,显示指定目录下的所有文件,但设置Tree的根目录时InsertItem的参数中需要一个 目录的句柄。
   请大家帮帮忙!

解决方案 »

  1.   

    你说的是InsertItem的参数中要一个句柄的意思吗?
    还是?
      

  2.   

    HTREEITEM hItem=m_tree.InsertItem("tmp",TVI_ROOT);
    m_tree.InsertItem("下面的文件夹“,hItem);
      

  3.   

    HANDLE CreateFile();
    他可以处理的
    files 
    pipes 
    mailslots 
    communications resources 
    disk devices (Windows NT only)
    consoles 
    directories (open only)!!!!!!!!!!!!!
    所以这个可以
      

  4.   

    CFileFind Dir;
    BOOL bWorking = Dir.FindFile(“e:\\test\\tmp\\*.*");
    while (bWorking)
    {
    bWorking = Dir.FindNextFile();   
    if (Dir.IsDots() == FALSE && Dir.IsHidden() == FALSE)
    {
                   插入Dir.GetFileName()到你的tree中
      

  5.   

    这个只能对文件适合,对文件夹呢?
    比如在c:\\abc\\dce    现在知道这个,如果dce的下面有a 和b两个文件夹呢,如何获取这两个文件夹的名字呢?