当前位置:网站首页>获取文件版权信息
获取文件版权信息
2022-07-02 09:45:00 【如鹿渴慕泉水】
BOOL lsGetFileLegalCopyright(LPCTSTR lptstrFilename, CString& strData)
{
if (lptstrFilename == NULL)
return FALSE;
DWORD dwHandle;
UINT dwBytesNeeded = GetFileVersionInfoSize(lptstrFilename, &dwHandle);
if (dwBytesNeeded > 0)
{
BYTE* lpVersionBlock = new BYTE[dwBytesNeeded];
if (lpVersionBlock == NULL)
return FALSE;
if (GetFileVersionInfo(lptstrFilename, 0, dwBytesNeeded, lpVersionBlock))
{
BYTE* lpTranslate = NULL;
if (VerQueryValue(lpVersionBlock, TEXT("\\VarFileInfo\\Translation"), (LPVOID*)&lpTranslate, &dwBytesNeeded) &&
(lpTranslate != NULL))
{
CString strSubBlock = TEXT(""), strTranslate = TEXT(""), strTranslation = TEXT("");
strTranslate.Format(TEXT("000%x"), *((unsigned short int*)lpTranslate));
strTranslation = strTranslate.Right(4);
strTranslate.Format(TEXT("000%x"), *((unsigned short int*) & lpTranslate[2]));
strTranslation += strTranslate.Right(4);
strSubBlock.Format(TEXT("\\StringFileInfo\\%s\\LegalCopyright"), strTranslation.GetBuffer(0));
if (VerQueryValue(lpVersionBlock, strSubBlock.GetBuffer(0), (LPVOID*)&lpTranslate, &dwBytesNeeded) &&
(lpTranslate != NULL))
{
strData.Format(TEXT("%s"), lpTranslate);
//LPTSTR lpszData = new TCHAR [dwBytesNeeded + 1];//强制多添加几个
//memset(lpszData, 0, sizeof(TCHAR)*(dwBytesNeeded + 1));
//memcpy(lpszData, lpTranslate, dwBytesNeeded);
//lpszData[dwBytesNeeded] = '\0'; //强制结尾
//strData.Format(TEXT("%s"), lpszData);
//delete [] lpszData;
}
delete[] lpVersionBlock;
return TRUE;
}
}
delete[] lpVersionBlock;
}
return FALSE;
}
边栏推荐
- JS10day(api 阶段性完结,正则表达式简介,自定义属性,过滤敏感词案例,注册模块验证案例)
- Go learning notes - multithreading
- Enhance network security of kubernetes with cilium
- 软件测试面试题-2022年大厂面试题合集
- How to write a pleasing English mathematical paper
- Day12 control flow if switch while do While guessing numbers game
- High performance erasure code coding
- BOM DOM
- Writing method of then part in drools
- Floyd AcWing 854. Floyd求最短路
猜你喜欢

The differences and relationships among port, targetport, nodeport and containerport in kubenetes

BOM DOM

Bom Dom

LTC3307AHV 符合EMI标准,降压转换器 QCA7005-AL33 PHY

分布式机器学习框架与高维实时推荐系统

Mysql database foundation

Deep Copy Event bus
![[FFH] little bear driver calling process (take calling LED light driver as an example)](/img/e7/153ae9f1befc12825d277620049f9d.jpg)
[FFH] little bear driver calling process (take calling LED light driver as an example)

arcgis js 4.x 地图中加入图片

spfa AcWing 852. spfa判断负环
随机推荐
Leetcode - Sword finger offer 37, 38
JS6day(DOM结点的查找、增加、删除。实例化时间,时间戳,时间戳的案例,重绘和回流)
[FFH] little bear driver calling process (take calling LED light driver as an example)
What data types does redis have and their application scenarios
Interview with meituan, a 34 year old programmer, was rejected: only those under the age of 30 who work hard and earn little overtime
Discrimination of the interval of dichotomy question brushing record (Luogu question sheet)
Deep Copy Event bus
drools执行指定的规则
Multiply LCA (nearest common ancestor)
MySQL and PostgreSQL methods to grab slow SQL
The programmer and the female nurse went on a blind date and spent 360. He packed leftovers and was stunned when he received wechat at night
OpenCV中cv2.VideoWriter_fourcc()函数和cv2.VideoWriter()函数的结合使用
This "little routine" is set on the dough cake of instant noodles. No wonder programmers are always hungry
防抖 节流
单指令多数据SIMD的SSE/AVX指令集和API
上传文件时,服务器报错:IOFileUploadException: Processing of multipart/form-data request failed. 设备上没有空间
Redis sentinel mechanism and configuration
The differences and relationships among port, targetport, nodeport and containerport in kubenetes
深拷貝 事件總線
Drools executes the specified rule