免费空间怎么搞网站,上海市建设厅网站,logo在线设计生成器标智客,外贸网站屏蔽国内ip使用API函数已经好几年了#xff0c;封装函数签名基本是参照MSDN上的文档#xff0c;然后再做数据类型对应。
虽然有 pinvoke.net 这个网站#xff0c;但基本很少使用。一方面是想多动手#xff0c;另一方面是因为各种数据类型基本都用过了#xff0c;都能自己在C#中 对应…使用API函数已经好几年了封装函数签名基本是参照MSDN上的文档然后再做数据类型对应。
虽然有 pinvoke.net 这个网站但基本很少使用。一方面是想多动手另一方面是因为各种数据类型基本都用过了都能自己在C#中 对应 起来。 最近在逛github时发现了一个官方的项目GitHub - dotnet/pinvoke: A library containing all P/Invoke code so you dont have to import it every time. Maintained and updated to support the latest Windows OS.这个项目是流行操作系统的所有P/Invoke方法签名的库集合。 LibraryPackage nameDescriptionadvapi32.dllPInvoke.AdvApi32Windows Advanced Servicesbcrypt.dllPInvoke.BCryptWindows Cryptography API: Next Generationcabinet.dllPInvoke.CabinetCabinet API Functionscfgmgr32.dllPInvoke.CfgMgr32Device and Driver Installationcrypt32.dllPInvoke.Crypt32Windows Cryptography APIDwmApi.dllPInvoke.DwmApiDesktop Window Managerfusion.dllPInvoke.Fusion.NET Framework Fusiongdi32.dllPInvoke.Gdi32Windows Graphics Device Interfacehid.dllPInvoke.HidWindows Human Interface Devicesiphlpapi.dllPInvoke.IPHlpApiIP Helperkernel32.dllPInvoke.Kernel32Windows Kernel APImagnification.dllPInvoke.MagnificationWindows Magnification APImscoree.dllPInvoke.MSCorEE.NET Framework CLR hostmsi.dllPInvoke.MsiMicrosoft Installerncrypt.dllPInvoke.NCryptWindows Cryptography API: Next Generationnetapi32.dllPInvoke.NetApi32Network Managementnewdev.dllPInvoke.NewDevDevice and Driver Installationntdll.dllPInvoke.NTDllWindows NTDllpsapi.dllPInvoke.PsapiWindows Process Status APIsetupapi.dllPInvoke.SetupApiWindows setup APISHCore.dllPInvoke.SHCoreWindows Shellshell32.dllPInvoke.Shell32Windows Shelluser32.dllPInvoke.User32Windows User Interfaceuserenv.dllPInvoke.UserenvWindows User Environmentuxtheme.dllPInvoke.UxThemeWindows Visual Styleswinusb.dllPInvoke.WinUsbUSB DriverWtsApi32.dllPInvoke.WtsApi32Windows Remote Desktop Services
例如要使用User32中的ShowWindow函数
1、导入Nuget包(PInvoke.User32) 2、使用 写在最后
有了这个项目以后调用API函数可以更方便。最重要的是官方提供了函数签名示例我们可以从里面学到很多东西。 2024.11.06更新
pinvoke项目已经废弃使用CsWin32项目替代使用方法跟上述基本一致。
CsWin32项目将不同的dll导出函数都放到一个包中不需要再去使用对应dll的包。
nuget搜索CsWin32包使用即可。