请问各位高手如何在(通过SHBrowseForFolder显示的)浏览目录对话框上增加一个New folder 按钮

解决方案 »

  1.   

    在XP中可通过添加新的风格实现,在9x/2K中使用SHBrowseForFolder无法直接实现。
      

  2.   

    为什么你们的可以??
    我的却不行:(我不import "shell32.dll"就报语法错,一加上又提示打不开此资源(文件是存在的,不然就会报文件不存在错误了)。
    怎么回事呀?
      

  3.   

    在98下可能不可以(我没有测试),但是在Win2000下绝对可以。你可以这样写:
    BROWSEINFO bi;
    char Buffer[MAX_PATH]; bi.hwndOwner = NULL;
    bi.pidlRoot = NULL;
    bi.pszDisplayName = Buffer;
    bi.lpszTitle = "Test";
    bi.ulFlags = 0;
    bi.lpfn = NULL;
    bi.iImage=IDI_PATH;
             bi.ulFlags=BIF_NEWDIALOGSTYLE;然后使用SHBrowseForFolder函数就可以了。
    MSDN下是这样说得:
    BIF_NEWDIALOGSTYLE
    Version 5.0. Use the new user interface. Setting this flag provides the user with a larger dialog box that can be resized. The dialog box has several new capabilities including: drag and drop capability within the dialog box, reordering, shortcut menus, new folders, delete, and other shortcut menu commands. To use this flag, you must call OleInitialize or CoInitialize before calling SHBrowseForFolder.