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:
|
run:
|
||||||
working-directory: ./YaeAchievement
|
working-directory: ./YaeAchievement
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Checkout Repo
|
||||||
|
uses: actions/checkout@v4
|
||||||
- name: Setup .NET
|
- name: Setup .NET
|
||||||
uses: actions/setup-dotnet@v4
|
uses: actions/setup-dotnet@v4
|
||||||
with:
|
with:
|
||||||
|
|||||||
31
.github/workflows/lib-nuget.yml
vendored
31
.github/workflows/lib-nuget.yml
vendored
@@ -2,29 +2,28 @@ name: YaeLib NuGet Publish
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
release:
|
inputs:
|
||||||
types: [released]
|
tags:
|
||||||
|
description: 'Version already increased?'
|
||||||
|
required: true
|
||||||
|
type: boolean
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish:
|
publish:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: ./YaeAchievementLib
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repo
|
- name: Checkout Repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
- name: Setup .NET
|
||||||
- name: Setup MSBuild
|
uses: actions/setup-dotnet@v4
|
||||||
uses: microsoft/setup-msbuild@v2
|
with:
|
||||||
|
dotnet-version: 9.0.x
|
||||||
- name: Restore NuGet Packages
|
- name: Restore dependencies
|
||||||
run: nuget restore lib\YaeAchievementLib.sln
|
run: dotnet restore
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
continue-on-error: true
|
run: dotnet publish
|
||||||
run: msbuild lib\YaeAchievementLib.sln /p:Configuration=Release
|
|
||||||
|
|
||||||
- name: Pack
|
|
||||||
run: nuget pack lib\YaeAchievementLib.nuspec
|
|
||||||
|
|
||||||
- name: Publish to NuGet
|
- name: Publish to NuGet
|
||||||
run: nuget push *.nupkg ${{ secrets.NUGET_API_KEY }} -src https://api.nuget.org/v3/index.json
|
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"/>
|
<Using Include="System.Diagnostics.CodeAnalysis"/>
|
||||||
</ItemGroup>
|
</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>
|
</Project>
|
||||||
|
|||||||
@@ -27,6 +27,11 @@ internal static unsafe class Application {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[UnmanagedCallersOnly(EntryPoint = "YaeWndHook")]
|
||||||
|
private static nint WndHook(int nCode, nint wParam, nint lParam) {
|
||||||
|
return User32.CallNextHookEx(0, nCode, wParam, lParam);
|
||||||
|
}
|
||||||
|
|
||||||
#region RecvPacket
|
#region RecvPacket
|
||||||
|
|
||||||
private static delegate*unmanaged<byte*, int, ushort> _toUInt16;
|
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)]
|
[LibraryImport("USER32.dll", StringMarshalling = StringMarshalling.Utf16, SetLastError = true)]
|
||||||
internal static partial int MessageBoxW(nint hWnd, string text, string caption, uint uType);
|
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