当前位置:网站首页>获取文件版权信息
获取文件版权信息
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;
}
边栏推荐
- Is the neural network (pinn) with embedded physical knowledge a pit?
- String palindrome hash template question o (1) judge whether the string is palindrome
- Error in kubeadm join: [error port-10250]: port 10250 is in use [error fileavailable--etc kubernetes PKI
- Drools terminates the execution of other rules after executing one rule
- [ybtoj advanced training guide] similar string [string] [simulation]
- 深拷贝 事件总线
- Interview with meituan, a 34 year old programmer, was rejected: only those under the age of 30 who work hard and earn little overtime
- Redis transaction mechanism implementation process and principle, and use transaction mechanism to prevent inventory oversold
- 堆 AcWing 839. 模拟堆
- Does C language srand need to reseed? Should srand be placed in the loop? Pseudo random function Rand
猜你喜欢

线性DP AcWing 897. 最长公共子序列

Adding database driver to sqoop of cdh6

Floyd AcWing 854. Floyd求最短路
![[old horse of industrial control] detailed explanation of Siemens PLC TCP protocol](/img/13/9002244555ebe8a61660c2506993fa.png)
[old horse of industrial control] detailed explanation of Siemens PLC TCP protocol

Addition, deletion, modification and query of MySQL table (Advanced)

深拷貝 事件總線

Deep copy event bus

Interview with meituan, a 34 year old programmer, was rejected: only those under the age of 30 who work hard and earn little overtime

区间DP AcWing 282. 石子合并

Multiply LCA (nearest common ancestor)
随机推荐
BOM DOM
drools执行完某个规则后终止别的规则执行
Post request body content cannot be retrieved repeatedly
Distributed machine learning framework and high-dimensional real-time recommendation system
Record the range of data that MySQL update will lock
How to write a pleasing English mathematical paper
JS7day(事件对象,事件流,事件捕获和冒泡,阻止事件流动,事件委托,学生信息表案例)
Anxiety of a 211 programmer: working for 3 years with a monthly salary of less than 30000, worried about being replaced by fresh students
分布式机器学习框架与高维实时推荐系统
Rust search server, rust quick service finding tutorial
线性DP AcWing 897. 最长公共子序列
Day12 control flow if switch while do While guessing numbers game
Visual studio efficient and practical extension tools and plug-ins
[ybtoj advanced training guide] similar string [string] [simulation]
spfa AcWing 851. spfa求最短路
SparkContext: Error initializing SparkContext解决方法
About asp Net MVC project in local vs running response time is too long to access, the solution!
spfa AcWing 852. spfa判断负环
The differences and relationships among port, targetport, nodeport and containerport in kubenetes
哈希表 AcWing 841. 字符串哈希