29.添加录入注入信息界面

上一个内容:28.启动与暂停程序

以 28.启动与暂停程序 它的代码为基础进行修改

效果图:

新建Dialog

给新建的dialog添加空间,如下图

给每个输入框创建一个变量

代码:


void CWndAddGame::OnBnClickedButton1()
{
    static TCHAR BASED_CODE szFilter[] = _T("exe (*.exe)|*.exe|dat (*.dat)|*.dat|All (*.*)|*.*||");
    // CFileDialog是mfc封装好的打开文件或另存为窗口
    CFileDialog dialog(TRUE, NULL, NULL, 6,szFilter);
    if (dialog.DoModal() == IDOK)
    {
        // 游戏可执行文件
        GameFullPath = dialog.GetPathName();
        // 游戏名称
        GameName = dialog.GetFileTitle();
        // 游戏路径
        GamePath = dialog.GetFolderPath() + L"\\";
        // 命令
        GameCmds = L"";
        UpdateData(FALSE);
    }
}


void CWndAddGame::OnBnClickedButton2()
{
    static TCHAR BASED_CODE szFilter[] = _T("动态链接库 (*.dll)|*.dll|All (*.*)|*.*||");
    // CFileDialog是mfc封装好的打开文件或另存为窗口
    CFileDialog dialog(TRUE, NULL, NULL, 6, szFilter);
    if (dialog.DoModal() == IDOK)
    {
        // 注入模块路径
        DllPath = dialog.GetPathName();
        UpdateData(FALSE);
    }
}


void CWndAddGame::OnBnClickedButton4()
{
    CDialog::OnCancel();
}


void CWndAddGame::OnBnClickedButton3()
{
    // TODO: 在此添加控件通知处理程序代码
}

它.h文件中的样子

相关推荐

  1. py注册登录界面

    2024-06-16 21:32:04       34 阅读
  2. MySQL 添加注释(comment)

    2024-06-16 21:32:04       36 阅读
  3. Android在系统界面添加窗口

    2024-06-16 21:32:04       30 阅读
  4. 修改添加数据界面的布局

    2024-06-16 21:32:04       7 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-06-16 21:32:04       19 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-06-16 21:32:04       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-06-16 21:32:04       20 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-06-16 21:32:04       20 阅读

热门阅读

  1. 常见的中间件都在解决什么问题?

    2024-06-16 21:32:04       7 阅读
  2. 大数据数仓30问

    2024-06-16 21:32:04       9 阅读
  3. rsync常用命令

    2024-06-16 21:32:04       7 阅读
  4. vue2 + echats macarons 选中样式的树状图

    2024-06-16 21:32:04       7 阅读
  5. 高效时间管理

    2024-06-16 21:32:04       6 阅读
  6. Leetcode 3. 无重复字符的最长子串

    2024-06-16 21:32:04       7 阅读
  7. C# —— while循环语句

    2024-06-16 21:32:04       6 阅读
  8. c++ 笔记二

    2024-06-16 21:32:04       6 阅读
  9. 什么是贸易顺差和贸易逆差?

    2024-06-16 21:32:04       6 阅读
  10. 通货膨胀和通货紧缩是什么?

    2024-06-16 21:32:04       5 阅读
  11. 软件服务中的 SLA 到底是什么?

    2024-06-16 21:32:04       8 阅读