支持多种格式的FileDialog,当存当前文件(“C:\\1.jpg”)时,选择下面的Type Combox时,选择BMP,点击OK,这时文件名还是1.jpg,所以系统会提示是否覆盖。怎么实现自动变成1.bmp?可以截获到CBN_TYPECHANGE消息,然后怎么改变文件名呢?多谢

解决方案 »

  1.   

    http://www.codeguru.com/Cpp/W-D/dislog/commondialogs/article.php/c1863/
      

  2.   

    CFileExportDialog dialog("Save As Type",                          // title
      "Windows Bitmap (*.bmp)|JPEG Compressed Image (*.jpg)|"\        // filter string..
      "Windows Meta File (*.wmf)|Windows Enhanced Meta File (*.emf)", // with file types
      "visualization.jpg");                                           // default filename (may be omitted)if (dialog.DoModal() == IDOK) {
      CString filename = dialog.GetPathName();
      int filetype = dialog.GetFilterIndex();
      SaveFile(filename, filetype); // defined somewhere in the application
    }
      

  3.   

    to lixiaosan:正是我想要的,多谢
      

  4.   

    to BLsoft(网龙)你什么意思~~~~~~~~~强烈bs你