From 79cd55f0bab53468e8bc95f46abec2074e1b426e Mon Sep 17 00:00:00 2001 From: barkermn01 Date: Thu, 23 Jan 2020 01:16:44 +0000 Subject: [PATCH] Fixed Input Hook for new Aali driver that uses FF7 instead of ff7 it now supports both formats --- UltrasoundInputHooker/Plugin.cs | 8 ++++++-- UltrasoundInputHooker/UltrasoundInputHooker.csproj.user | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/UltrasoundInputHooker/Plugin.cs b/UltrasoundInputHooker/Plugin.cs index c952f01..84b336d 100644 --- a/UltrasoundInputHooker/Plugin.cs +++ b/UltrasoundInputHooker/Plugin.cs @@ -19,6 +19,9 @@ public class Plugin : _7HPlugin [DllImport("user32.dll")] public static extern IntPtr SetFocus(IntPtr hWnd); + [DllImport("Kernel32.dll")] + public static extern void AllocConsole(); + [DllImport("Kernel32.dll")] public static extern IntPtr GetCurrentThreadId(); @@ -109,7 +112,7 @@ private void getProccess() { Process[] processes = Process.GetProcesses(); Console.WriteLine("Proccesses found."); - Regex test = new Regex(@"ff7(_[a-z]{2}){0,1}\.exe"); + Regex test = new Regex(@"[fF][fF]7(_[a-z]{2}){0,1}\.exe"); foreach(Process proc in processes) { try @@ -157,7 +160,8 @@ private void getKeys() } public override void Start(RuntimeMod mod) - { + { + AllocConsole(); soundCompleteId = hooks_instance.hookSoundComplete(new SoundCompleteAction((int soundId, string f) => { Console.WriteLine("Sound from file " + f + " has finished"); diff --git a/UltrasoundInputHooker/UltrasoundInputHooker.csproj.user b/UltrasoundInputHooker/UltrasoundInputHooker.csproj.user index 33458b3..3004e63 100644 --- a/UltrasoundInputHooker/UltrasoundInputHooker.csproj.user +++ b/UltrasoundInputHooker/UltrasoundInputHooker.csproj.user @@ -2,6 +2,6 @@ Program - D:\Games\FF7-heaven v1.54\7thHeaven.exe + D:\Projects\GitHub\7h\.dist\Build\Debug\7thHeaven.exe \ No newline at end of file