zoukankan      html  css  js  c++  java
  • VC++显示文件或文件夹属性

      When you select a file or folder in Explorer window, and choose 'Properties' from the menu, you get the properties window that contains some essential information about the file: The size of file, created date, modified date, attributes, and so on.
      It's possible to display this properties window programmatically, by using the ShellExecuteEx API function. 
      The function below accept 2 parameters, and displays the properties window of the file: 
      hwnd - The handle of the window that calls this function. 
      lpszFile - The file or folder that you want to display its properties. 

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
     
    void ShowFileProperties(HWND hwnd, LPCWSTR lpszFile)
    {
        SHELLEXECUTEINFO ShExecInfo = {
    0};

        ShExecInfo.cbSize = 
    sizeof(SHELLEXECUTEINFO);
        ShExecInfo.fMask = SEE_MASK_INVOKEIDLIST ;
        ShExecInfo.hwnd = hwnd;
        ShExecInfo.lpVerb = _T(
    "properties");
        ShExecInfo.lpFile = lpszFile;
        ShExecInfo.lpParameters = _T(
    ""); 
        ShExecInfo.lpDirectory = 
    NULL;
        ShExecInfo.nShow = SW_SHOW;
        ShExecInfo.hInstApp = 
    NULL
        ShellExecuteEx(&ShExecInfo);
    }

  • 相关阅读:
    自动构建部署
    EF 性能调优
    断点续传
    gis 相关资料
    easyui 特殊操作
    KJ面试
    前端面试题汇总
    es6之扩展运算符 三个点(...)
    vue.js开发环境搭建
    gulp 环境搭建
  • 原文地址:https://www.cnblogs.com/MakeView660/p/7773613.html
Copyright © 2011-2022 走看看