文件浏览对话框

 新式浏览对话框样式
 char fileName[MAX_PATH] = "";  //windef.h里面有这句#define MAX_PATH          260
    CFileDialog dlgFile(TRUE);
 //if use new style!
    OSVERSIONINFO VersionInformation;  
    GetVersionEx(&VersionInformation);
    if (VersionInformation.dwMajorVersion >= 5)
        dlgFile.m_ofn.lStructSize = 88;  // new = 88   详见MSDN
    else
        dlgFile.m_ofn.lStructSize = 76;   // old = 76

 //do not use it ! dlgFile.m_ofn.Flags |= OFN_ENABLETEMPLATEHANDLE;
    //dlgFile.m_ofn.Flags |= OFN_ENABLETEMPLATE;         // add our temp !
    dlgFile.m_ofn.lpstrTitle = "浏览";
    //dlgFile.m_ofn.lpstrFile = fileName;
    dlgFile.m_ofn.Flags |= OFN_EXPLORER;
 //'Clip siblings' 'Child' 'None' '3Dlook' 'Control' 'Visible'
    //dlgFile.m_ofn.lpTemplateName = MAKEINTRESOURCE(IDD_EX_OPEN); //=1547!
    //dlgFile.m_ofn.hInstance=AfxGetInstanceHandle();
    dlgFile.m_ofn.lpstrFilter = "程序/0*.exe/0所有文件/0*.*/0";
    //dlgFile.m_ofn.lpstrDefExt = "txt";
 // show
    dlgFile.DoModal();
#ifdef _DEBUG
    afxDump << fileName << " /n";
#endif
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值