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);
    }

  • 相关阅读:
    javascript和C#比较
    前端模块管理器简介
    javascript中的splice方法介绍&示例
    javascript中数组揭秘
    17款code review工具
    IIS ip访问限制插件
    iis 限制动态IP地址访问次数
    AWS云使用100条宝贵经验分享
    C# 开源框架(整理)
    如何获取Azure AD tenant的tenant Id?
  • 原文地址:https://www.cnblogs.com/MakeView660/p/7773613.html
Copyright © 2011-2022 走看看