当前位置: 首页>>代码示例>>C++>>正文


C++ COptions::GetOFNFolder方法代码示例

本文整理汇总了C++中COptions::GetOFNFolder方法的典型用法代码示例。如果您正苦于以下问题:C++ COptions::GetOFNFolder方法的具体用法?C++ COptions::GetOFNFolder怎么用?C++ COptions::GetOFNFolder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在COptions的用法示例。


在下文中一共展示了COptions::GetOFNFolder方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: AddDialogProc

UINT_PTR CALLBACK CFileDialog::AddDialogProc(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam)
{
    UNREFERENCED_PARAMETER(wParam);

    COptions *pOptions = g_app.GetOptions();

    switch (uiMsg)
    {
    case WM_INITDIALOG:
        ::SendMessage(GetDlgItem(hdlg, IDC_INCLUDE), CB_LIMITTEXT, MAX_PATH - 1, 0);
        ::SendMessage(GetDlgItem(hdlg, IDC_EXCLUDE), EM_LIMITTEXT, MAX_PATH - 1, 0);
        CheckDlgButton(hdlg, IDC_AUTO_START, pOptions->GetAutoStart(TRUE));
        EnableWindow(GetDlgItem(hdlg, IDC_CHECK_NEW_ONLY), pOptions->GetAutoStart(TRUE));
        CheckDlgButton(hdlg, IDC_CHECK_NEW_ONLY, pOptions->GetCheckNewOnly(TRUE));
        SendMessage(GetDlgItem(hdlg, IDC_INCLUDE), CB_ADDSTRING, 0, (LPARAM)MOD_INCLUDE_COMMON);
        SendMessage(GetDlgItem(hdlg, IDC_INCLUDE), CB_ADDSTRING, 0, (LPARAM)MOD_INCLUDE_EXE);
        SendMessage(GetDlgItem(hdlg, IDC_INCLUDE), CB_ADDSTRING, 0, (LPARAM)MOD_INCLUDE_ALL);
        SetDlgItemText(hdlg, IDC_INCLUDE, pOptions->GetInclude(TRUE));
        SetDlgItemText(hdlg, IDC_EXCLUDE, pOptions->GetExclude(TRUE));
        CheckDlgButton(hdlg, IDC_RECURSE, pOptions->GetRecurse(TRUE));
        CheckDlgButton(hdlg, IDC_SAVE_SETTINGS, FALSE);
        return (UINT_PTR)TRUE;

    case WM_NOTIFY:
        switch (((LPNMHDR)lParam)->code)
        {
        case CDN_FOLDERCHANGE:
            // POST
            PostMessage(GetParent(hdlg), CDM_SETCONTROLTEXT, edt1, (LPARAM)pOptions->GetOFNFolder());
            break;

        case CDN_FILEOK:
            if (IsDlgButtonChecked(hdlg, IDC_SAVE_SETTINGS) == BST_CHECKED)
                pOptions->SetFlag(COptions::OnceAdd | COptions::OnceCheck, COptions::OnceCheck);
            else
                pOptions->SetFlag(COptions::OnceAdd | COptions::OnceCheck, COptions::OnceAdd | COptions::OnceCheck);
            pOptions->SetAutoStart(IsDlgButtonChecked(hdlg, IDC_AUTO_START) == BST_CHECKED);
            pOptions->SetCheckNewOnly(IsDlgButtonChecked(hdlg, IDC_CHECK_NEW_ONLY) == BST_CHECKED);
            GetDlgItemText(hdlg, IDC_INCLUDE, (LPTSTR)pOptions->GetInclude(), MAX_PATH);
            GetDlgItemText(hdlg, IDC_EXCLUDE, (LPTSTR)pOptions->GetExclude(), MAX_PATH);
            pOptions->SetRecurse(IsDlgButtonChecked(hdlg, IDC_RECURSE) == BST_CHECKED);
            if (IsDlgButtonChecked(hdlg, IDC_SAVE_SETTINGS) == BST_CHECKED)
                pOptions->SavePage(MOPSP_ADD);
            break;
        }
        break;

    case WM_COMMAND:
        switch (wParam)
        {
        case MAKEWPARAM(IDC_AUTO_START, BN_CLICKED):
            EnableWindow(GetDlgItem(hdlg, IDC_CHECK_NEW_ONLY), IsDlgButtonChecked(hdlg, IDC_AUTO_START) == BST_CHECKED);
            break;
        }
        break;
    }

    return (UINT_PTR)FALSE;
}
开发者ID:feng1st,项目名称:md5checker,代码行数:59,代码来源:FileDialog.cpp


注:本文中的COptions::GetOFNFolder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。