访问Windows API的常量和结构的的P / Invoke [英] Accessing Windows API Constants and Structs for P/Invoke

查看:231
本文介绍了访问Windows API的常量和结构的的P / Invoke的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

快速的问题:我如何可以访问从.NET中的Win32 API定义的BN_CLICKED常量和其他的常量?他们是否在某些库中定义?我一定要定义他们自己?如果是这样,我在哪里可以找到这些值?并且是值特定版本的Windows版本之间?

Quick question: How can I access the BN_CLICKED constant and other constants defined for the Win32 API from .NET? Are they defined in some library? Do I have to define them myself? If so, where can I find these values? And are the values version-specific between versions of Windows?

推荐答案

我找到的PInvoke互操作助理是很有益的: <一href="http://blogs.microsoft.co.il/blogs/sasha/archive/2008/01/12/p-invoke-signature-generator.aspx">http://blogs.microsoft.co.il/blogs/sasha/archive/2008/01/12/p-invoke-signature-generator.aspx.

I find the PInvoke Interop Assistant to be really helpful: http://blogs.microsoft.co.il/blogs/sasha/archive/2008/01/12/p-invoke-signature-generator.aspx.

它拥有几乎一切,可转换C ++到C#/ VB为您服务。我很少,如果有的话,求助于谷歌搜索/ pinvoke.net了。

It has almost everything and can convert the C++ to C#/VB for you. I rarely, if ever, resort to searching google/pinvoke.net anymore.

下面是MSDN杂志文章:<一个href="http://msdn.microsoft.com/en-us/magazine/cc164193.aspx">http://msdn.microsoft.com/en-us/magazine/cc164193.aspx

Here's the MSDN Magazine Article: http://msdn.microsoft.com/en-us/magazine/cc164193.aspx

和这里的下载:<一href="http://download.microsoft.com/download/f/2/7/f279e71e-efb0-4155-873d-5554a0608523/CLRInsideOut2008_01.exe">http://download.microsoft.com/download/f/2/7/f279e71e-efb0-4155-873d-5554a0608523/CLRInsideOut2008_01.exe

这篇关于访问Windows API的常量和结构的的P / Invoke的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆