本文介绍了C# 在 64 位系统上调用 user32.dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 64 位 Windows 上从 64 位应用程序 pinvoke user32.dll 是错误的吗?我已经成功地完成了多次并且从未出现过错误,但这似乎是矛盾的.我应该查找 user64.dll 吗?

Is it wrong to pinvoke user32.dll on 64 bit Windows, from a 64 bit app? I've done this successfully a number of times and never had an error, but it seems contradictory. Should I look for user64.dll instead?

推荐答案

user32.dll 名称具有误导性.这是您正在调用的 user32.dll 的 64 位版本.64 位版本位于 %windir%System32user32.dll.

The name user32.dll is misleading. It's the 64 bit version of user32.dll you're calling. The 64 bit version is located at %windir%System32user32.dll.

包含 32 位版本是为了与 32 位应用程序兼容.它位于 %windir%SysWOW64user32.dll.您可以使用 dumpbin 实用程序检查它们:

A 32-bit version is included for compatibility with 32-bit applications. It's located at %windir%SysWOW64user32.dll. You can inspect them using the dumpbin utility:

System32user32.dll:

System32user32.dll:

FILE HEADER VALUES
        8664 machine (x64)

SysWOW64user32.dll:

SysWOW64user32.dll:

FILE HEADER VALUES
         14C machine (x86)

这篇关于C# 在 64 位系统上调用 user32.dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-04 13:48