当前位置:网站首页>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;
}
边栏推荐
- Interesting interview questions
- 一些突然迸发出的程序思想(模块化处理)
- H5 to app
- 包管理工具
- Why do programmers have the idea that code can run without moving? Is it poisonous? Or what?
- Wechat official account payment prompt MCH_ ID parameter format error
- [ybtoj advanced training guidance] judgment overflow [error]
- 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
- Direct control PTZ PTZ PTZ PTZ camera debugging (c)
- Floyd AcWing 854. Floyd finds the shortest path
猜你喜欢

包管理工具

JSON serialization and parsing
![1380. Lucky numbers in the matrix [two-dimensional array, matrix]](/img/8c/c050af5672268bc7e0df3250f7ff1d.jpg)
1380. Lucky numbers in the matrix [two-dimensional array, matrix]

C#运算符

Distributed machine learning framework and high-dimensional real-time recommendation system

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

Use sqoop to export ads layer data to MySQL

Embedded Software Engineer career planning
![2.6 using recursion and stack - [tower of Hanoi problem]](/img/fc/45038170dafd104691c93716b103cf.jpg)
2.6 using recursion and stack - [tower of Hanoi problem]

计数类DP AcWing 900. 整数划分
随机推荐
1380. Lucky numbers in the matrix [two-dimensional array, matrix]
. Net wechat message template push
Is the neural network (pinn) with embedded physical knowledge a pit?
js1day(輸入輸出語法,數據類型,數據類型轉換,var和let區別)
2.6 using recursion and stack - [tower of Hanoi problem]
JSON序列化 与 解析
获取文件版权信息
Execute any method of any class through reflection
OpenCV中cv2.VideoWriter_fourcc()函数和cv2.VideoWriter()函数的结合使用
[ybtoj advanced training guidance] cross the river [BFS]
NTMFS4C05NT1G N-CH 30V 11.9A MOS管,PDF
C#修饰符
Deep Copy Event bus
How to write a pleasing English mathematical paper
Dijkstra AcWing 850. Dijkstra求最短路 II
js2day(又是i++和++i,if语句,三元运算符,switch、while语句,for循环语句)
JDBC 预防sql注入问题与解决方法[PreparedStatement]
Does C language srand need to reseed? Should srand be placed in the loop? Pseudo random function Rand
js5day(事件监听,函数赋值给变量,回调函数,环境对象this,全选反选案例,tab栏案例)
Fluent fluent library encapsulation