mirror of
https://github.com/HolographicHat/Yae.git
synced 2025-12-06 14:42:52 +08:00
add wndhook
This commit is contained in:
@@ -41,4 +41,24 @@
|
||||
<Using Include="System.Diagnostics.CodeAnalysis"/>
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<PackageId>Yae.Lib</PackageId>
|
||||
<Version>5.4.0</Version>
|
||||
<Authors>HoloHat</Authors>
|
||||
<DevelopmentDependency>true</DevelopmentDependency>
|
||||
<PackageLicenseExpression>GPL-3.0-only</PackageLicenseExpression>
|
||||
<RepositoryUrl>https://github.com/HolographicHat/Yae</RepositoryUrl>
|
||||
<Description>Yae Lib</Description>
|
||||
<IncludeBuildOutput>false</IncludeBuildOutput>
|
||||
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="$(PublishDir)\$(TargetName)$(NativeBinaryExt)" Pack="true" PackagePath="runtimes\win-x64\native" Visible="false"/>
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="GenerateNuGetPackage" AfterTargets="CopyNativeBinary">
|
||||
<Exec Command="dotnet pack --no-build --nologo" UseUtf8Encoding="Always" EchoOff="true"/>
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -27,6 +27,11 @@ internal static unsafe class Application {
|
||||
return 0;
|
||||
}
|
||||
|
||||
[UnmanagedCallersOnly(EntryPoint = "YaeWndHook")]
|
||||
private static nint WndHook(int nCode, nint wParam, nint lParam) {
|
||||
return User32.CallNextHookEx(0, nCode, wParam, lParam);
|
||||
}
|
||||
|
||||
#region RecvPacket
|
||||
|
||||
private static delegate*unmanaged<byte*, int, ushort> _toUInt16;
|
||||
|
||||
@@ -65,4 +65,7 @@ internal static unsafe partial class User32 {
|
||||
[LibraryImport("USER32.dll", StringMarshalling = StringMarshalling.Utf16, SetLastError = true)]
|
||||
internal static partial int MessageBoxW(nint hWnd, string text, string caption, uint uType);
|
||||
|
||||
[LibraryImport("USER32.dll")]
|
||||
internal static partial nint CallNextHookEx(nint hhk, int nCode, nint wParam, nint lParam);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user