zoukankan      html  css  js  c++  java
  • Win32 SDK

     

    OPENFILENAME ofn;     // common dialog box structure
    TCHAR szFile[MAX_PATH];  // buffer for file name

    // Initialize OPENFILENAME
    ZeroMemory(&ofn, sizeof(ofn));
    ofn.lStructSize = sizeof(ofn);
    ofn.hwndOwner = hwndDlg;
    ofn.lpstrFile = szFile;
    ofn.lpstrFile[0] = '';    //
                   // Set lpstrFile[0] to '' so that GetOpenFileName does not
                   // use the contents of szFile to initialize itself.
                   //
    ofn.nMaxFile = sizeof(szFile);
    ofn.lpstrFilter = _T("Text files (*.txt)*.txt");
    ofn.nFilterIndex = 1;
    ofn.lpstrFileTitle = NULL;
    ofn.nMaxFileTitle = 0;
    ofn.lpstrInitialDir = NULL;
    ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
    ofn.lpstrTitle = _T("打开");  // set the dialog box title

    if (GetOpenFileName(&ofn))
    {
      SetDlgItemText(hwndDlg, IDC_EDIT1, szFile);
    }

     

  • 相关阅读:
    SQL SELECT DISTINCT 语句
    SQL SELECT 语句
    SQL 语法
    Linux 命令大全
    MySQL 安装
    Nginx 安装配置
    linux yum 命令
    Linux 磁盘管理
    Linux 文件与目录管理
    Linux 用户和用户组管理
  • 原文地址:https://www.cnblogs.com/huhu0013/p/4171373.html
Copyright © 2011-2022 走看看