当前位置:网站首页>Win32控件------------显示系统使用的控件版本
Win32控件------------显示系统使用的控件版本
2022-08-09 10:09:00 【我有梦之翼】
#include <windows.h>
#include <windef.h>
#include <winbase.h>
#include <shlwapi.h>
#include<stdio.h>
#define PACKVERSION(major,minor) MAKELONG(minor,major)
DWORD GetVersion(LPCTSTR lpszDllName)
{
HINSTANCE hinstDll;
DWORD dwVersion = 0;
// For security purposes, LoadLibrary should be provided with a fully qualified
// path to the DLL. The lpszDllName variable should be tested to ensure that it
// is a fully qualified path before it is used.
hinstDll = LoadLibrary(lpszDllName);
if(hinstDll)
{
DLLGETVERSIONPROC pDllGetVersion;
pDllGetVersion = (DLLGETVERSIONPROC)GetProcAddress(hinstDll, "DllGetVersion");
// Because some DLLs might not implement this function, you must test for
// it explicitly. Depending on the particular DLL, the lack of a DllGetVersion
// function can be a useful indicator of the version.
if(pDllGetVersion)
{
DLLVERSIONINFO dvi;
HRESULT hr;
ZeroMemory(&dvi, sizeof(dvi));
dvi.cbSize = sizeof(dvi);
hr = (*pDllGetVersion)(&dvi);
if(SUCCEEDED(hr))
{
dwVersion = PACKVERSION(dvi.dwMajorVersion, dvi.dwMinorVersion);
}
}
FreeLibrary(hinstDll);
}
return dwVersion;
}
void main()
{
LPCTSTR lpszDllName = TEXT("C:\\Windows\\System32\\ComCtl32.dll");
DWORD dwVer = GetVersion(lpszDllName);
printf("Version:%X\n",dwVer);
system("pause");
}
边栏推荐
猜你喜欢
随机推荐
循环嵌套以及列表的基本操作
Tom Morgan | 人生二十一条法则
1: bubble sort
Technology Sharing | Sending Requests Using cURL
字符串函数和内存函数
分类预测 | MATLAB实现CNN-GRU(卷积门控循环单元)多特征分类预测
Umi Hooks
需求侧电力负荷预测(Matlab代码实现)
Multi-threaded cases - timer
[贴装专题] 视觉贴装平台与贴装流程介绍
2021-01-11-雪碧图做表情管理器
xmms播放器加了播放列表的管理功能
SQL Server查询优化
拿下跨界C1轮投资,本土Tier 1高阶智能驾驶系统迅速“出圈”
元组 字典 集合
常用的一些制表符号
学长告诉我,大厂MySQL都是通过SSH连接的
Thread,Runnable,ExecutorService线程池控制下线程量
借问变量何处存,牧童笑称用指针,Go lang1.18入门精炼教程,由白丁入鸿儒,go lang类型指针(Pointer)的使用EP05
antd表单


![[ASM] Bytecode operation MethodVisitor case combat generation object](/img/a9/df07614f875794d55d530bd04dc476.jpg)
![[相机配置] 海康相机丢包配置环境](/img/e2/23209f09f1716a6b7e8808082f6aa4.png)





