mirror of
https://github.com/HolographicHat/Yae.git
synced 2025-12-06 14:42:52 +08:00
add wndhook
This commit is contained in:
3
.github/workflows/dotnet.yml
vendored
3
.github/workflows/dotnet.yml
vendored
@@ -13,7 +13,8 @@ jobs:
|
||||
run:
|
||||
working-directory: ./YaeAchievement
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
|
||||
31
.github/workflows/lib-nuget.yml
vendored
31
.github/workflows/lib-nuget.yml
vendored
@@ -2,29 +2,28 @@ name: YaeLib NuGet Publish
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
release:
|
||||
types: [released]
|
||||
inputs:
|
||||
tags:
|
||||
description: 'Version already increased?'
|
||||
required: true
|
||||
type: boolean
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: windows-latest
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ./YaeAchievementLib
|
||||
steps:
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup MSBuild
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
|
||||
- name: Restore NuGet Packages
|
||||
run: nuget restore lib\YaeAchievementLib.sln
|
||||
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: 9.0.x
|
||||
- name: Restore dependencies
|
||||
run: dotnet restore
|
||||
- name: Build
|
||||
continue-on-error: true
|
||||
run: msbuild lib\YaeAchievementLib.sln /p:Configuration=Release
|
||||
|
||||
- name: Pack
|
||||
run: nuget pack lib\YaeAchievementLib.nuspec
|
||||
|
||||
run: dotnet publish
|
||||
- name: Publish to NuGet
|
||||
run: nuget push *.nupkg ${{ secrets.NUGET_API_KEY }} -src https://api.nuget.org/v3/index.json
|
||||
|
||||
@@ -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