当前位置:网站首页>获取文件版权信息
获取文件版权信息
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;
}
边栏推荐
- . Net wechat message template push
- 寻找二叉树中任意两个数的公共祖先
- 一些突然迸发出的程序思想(模块化处理)
- Go学习笔记—基于Go的进程间通信
- Interview with meituan, a 34 year old programmer, was rejected: only those under the age of 30 who work hard and earn little overtime
- 哈希表 AcWing 841. 字符串哈希
- Addition, deletion, modification and query of MySQL table (Advanced)
- Visual studio efficient and practical extension tools and plug-ins
- Sweetheart leader: Wang Xinling
- Record the range of data that MySQL update will lock
猜你喜欢

Less than three months after the programmer was hired, the boss wanted to launch the app within one month. If he was dissatisfied, he was dismissed immediately

中国交通标志检测数据集

Enhance network security of kubernetes with cilium

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

Redis bloom filter

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

JS8day(滚动事件(scroll家族),offset家族,client家族,轮播图案例(待做))

Map and set

"As a junior college student, I found out how difficult it is to counter attack after graduation."

Openssh remote enumeration username vulnerability (cve-2018-15473)
随机推荐
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
堆 AcWing 838. 堆排序
arcgis js 4. Add pictures to x map
Find the common ancestor of any two numbers in a binary tree
JS8day(滚动事件(scroll家族),offset家族,client家族,轮播图案例(待做))
趣味 面试题
Win10 system OmniPeek wireless packet capturing network card driver failed to install due to digital signature problem solution
Enhance network security of kubernetes with cilium
FBX import under ue4/ue5 runtime
防抖 节流
[ybtoj advanced training guidance] cross the river [BFS]
NTMFS4C05NT1G N-CH 30V 11.9A MOS管,PDF
MySQL与PostgreSQL抓取慢sql的方法
染色法判定二分图 AcWing 860. 染色法判定二分图
VLAN experiment
drools动态增加、修改、删除规则
JSON序列化 与 解析
单指令多数据SIMD的SSE/AVX指令集和API
Input box assembly of the shutter package