当前位置:网站首页>Obtain file copyright information
Obtain file copyright information
2022-07-02 12:46:00 【As the deer 】
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];// Force to add more
//memset(lpszData, 0, sizeof(TCHAR)*(dwBytesNeeded + 1));
//memcpy(lpszData, lpTranslate, dwBytesNeeded);
//lpszData[dwBytesNeeded] = '\0'; // Forced ending
//strData.Format(TEXT("%s"), lpszData);
//delete [] lpszData;
}
delete[] lpVersionBlock;
return TRUE;
}
}
delete[] lpVersionBlock;
}
return FALSE;
}
边栏推荐
- Use sqoop to export ads layer data to MySQL
- C#修饰符
- Fluent fluent library encapsulation
- Rust search server, rust quick service finding tutorial
- JSON serialization and parsing
- About the loading of layer web spring layer components, the position of the layer is centered
- Lekao.com: experience sharing of junior economists and previous candidates in customs clearance
- js 迭代器 生成器 异步代码处理 promise+生成器 -> await/async
- Counting class DP acwing 900 Integer partition
- What is the relationship between NFT and metauniverse? How to view the market? The future market trend of NFT
猜你喜欢

AI mid stage technology research

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

PR 2021 quick start tutorial, learn about the and functions of the timeline panel

传感器 ADXL335BCPZ-RL7 3轴 加速度计 符合 RoHS/WEEE

JS6day(DOM结点的查找、增加、删除。实例化时间,时间戳,时间戳的案例,重绘和回流)

线性DP AcWing 897. 最长公共子序列
![1380. Lucky numbers in the matrix [two-dimensional array, matrix]](/img/8c/c050af5672268bc7e0df3250f7ff1d.jpg)
1380. Lucky numbers in the matrix [two-dimensional array, matrix]

Interval DP acwing 282 Stone merging

BOM DOM

Direct control PTZ PTZ PTZ PTZ camera debugging (c)
随机推荐
Linear DP acwing 899 Edit distance
IPhone 6 plus is listed in Apple's "retro products" list
趣味 面试题
Input box assembly of the shutter package
浏览器node事件循环
Redis avalanche, penetration, breakdown
Intel internal instructions - AVX and avx2 learning notes
Docsify deploy IIS
Interesting interview questions
1380. Lucky numbers in the matrix [two-dimensional array, matrix]
. Net wechat message template push
ArrayList与LinkedList效率的对比
Leetcode - Sword finger offer 37, 38
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
堆 AcWing 838. 堆排序
[FFH] little bear driver calling process (take calling LED light driver as an example)
Hash table acwing 840 Simulated hash table
区间DP AcWing 282. 石子合并
Leetcode - < dynamic planning special> Jianzhi offer 19, 49, 60
JS10day(api 阶段性完结,正则表达式简介,自定义属性,过滤敏感词案例,注册模块验证案例)