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 = {};

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

VC++显示文件或文件夹属性的更多相关文章

  1. VC 获取指定文件夹路径的方法小结

    VC获取指定文件夹路径 flyfish  2010-3-5 一 使用Shell函数 1 获取应用程序的安装路径 TCHAR buf[_MAX_PATH];SHGetSpecialFolderPath( ...

  2. TDirectory.GetAttributes、TDirectory.SetAttributes获取和设置文件夹属性

    使用函数: System.IOUtils.TDirectory.GetAttributes//获取属性 System.IOUtils.TDirectory.SetAttributes//设置属性 注: ...

  3. 使用VC++压缩解压缩文件夹

    前言   项目中要用到一个压缩解压缩的模块, 看了很多文章和源代码,  都不是很称心, 现在把我自己实现的代码和大家分享. 要求: 1.使用Unicode(支持中文). 2.使用源代码.(不使用静态或 ...

  4. [sharepoint]rest api文档库文件上传,下载,拷贝,剪切,删除文件,创建文件夹,修改文件夹属性,删除文件夹,获取文档列表

    写在前面 最近对文档库的知识点进行了整理,也就有了这篇文章,当时查找这些接口,并用在实践中,确实废了一些功夫,也为了让更多的人走更少的弯路. 系列文章 sharepoint环境安装过程中几点需要注意的 ...

  5. VC下遍历文件夹中的所有文件的几种方法

    一.使用::FindFirstFile和::FindNextFile方法 #include "StdAfx.h" #include <windows.h> #inclu ...

  6. Linux ->> Chmod命令改变文件/文件夹属性

    简介 chmod命令用于改变linux系统文件或目录的访问权限,控制用户/用户组对文件或目录的访问权限. 用法: 两种用法:1)用字母r(读).w(写).x(执行)表示权限类型:2)用数字表示,4代表 ...

  7. Linux文件(夹)属性与权限

    文件属性与权限,文件权限设置 参考资料:鸟哥的Linux私房菜 用户与用户组 Linux系统是一个多用户多任务的分时操作系统,任何一个要使用系统资源的用户,都必须首先向系统管理员申请一个账号,然后以这 ...

  8. dos添加文件夹属性!

    attrib 显示所有文件的属性:参数:+r或-r [文件名] 设置文件属性是否为只读 +h或-h [文件名] 设置文件属性是否隐含 +s或-s [文件名] 设置文件属性是否为系统文件 +a或-a [ ...

  9. linux 显示文件或文件夹

    用 -v 很简单呀! 显示文件 ls -l | grep -v '^d'显示目录 ls -l | grep '^d'

随机推荐

  1. Unity3D实现3D立体游戏原理及过程,需偏振眼镜3D显

    http://tieba.baidu.com/p/3038509618?fr=ala0&pstaala=3

  2. 算法笔记_083:蓝桥杯练习 合并石子(Java)

    目录 1 问题描述 2 解决方案   1 问题描述 问题描述 在一条直线上有n堆石子,每堆有一定的数量,每次可以将两堆相邻的石子合并,合并后放在两堆的中间位置,合并的费用为两堆石子的总数.求把所有石子 ...

  3. CSS 盒状模型简介

    框的构成以及相关 CSS 特性( property ) 结构 为了给文档树中的各个元素排版定位(布局),浏览器会根据渲染模型1为每个元素生成四个嵌套的矩形框, 分别称作 content box.pad ...

  4. Linux程序存储结构与进程结构 堆和栈的差别

    摘要:本文主要讲述了Linux系统中.程序存储结构(代码区.数据段和BBS区)与进程的基本结构(代码区.数据段.BBS区.堆和栈).以及堆和栈的差别. Linux程序存储结构与进程结构 1.Linux ...

  5. sql server 数据加密

    select EncryptByPassPhrase('hksjlm',qlrmc)jmsj,* into jmqlr from qlr where qlbh in('5201411120005',' ...

  6. 安装Redmine 2.3.0(Ubuntu 12.04 Server)

    怀揣着为中小企业量身定做一整套开源软件解决方案的梦想开始了一个网站的搭建.http://osssme.org/ 安装Redmine 2.3.0(Ubuntu 12.04 Server) 翻译源\参考源 ...

  7. SSH登陆响应慢的问题

    http://xiaobin.net/201112/ssh-login-quite-slow/ 同样的问题,有可能是两种情况: 第一种情况比较常见,也有很多资料提及到,就是在SSH登陆时服务器端会对客 ...

  8. PHPExcel_Reader_Exception: is not recognised as an OLE file in Classes问题解决方法

    $filename="student.xlsx";//指定excel文件 $temp=substr($filename,strpos($filename,"." ...

  9. 读取properties属性文件——国际化

    public class PropertiesInfo { /** * PropertiesInfo实例 */ private static PropertiesInfo pi = null; pri ...

  10. SET IDENTITY_INSERT <Table Name> ON/OFF 转载

    This command is from SQL Server.  This command is to enable the users to set their own value for IDE ...