From ee4c6685145189072a3c1d30ad8ff049c005322a Mon Sep 17 00:00:00 2001 From: josh Date: Sun, 9 Nov 2025 19:23:54 +1000 Subject: [PATCH] Initial Commit --- .gitignore | 73 ++++++++++++++++++++++++++++ TuneBladeFixer.sln | 16 ++++++ TuneBladeFixer/Program.fs | 45 +++++++++++++++++ TuneBladeFixer/TuneBladeFixer.fsproj | 12 +++++ 4 files changed, 146 insertions(+) create mode 100644 .gitignore create mode 100644 TuneBladeFixer.sln create mode 100644 TuneBladeFixer/Program.fs create mode 100644 TuneBladeFixer/TuneBladeFixer.fsproj diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..51a532d --- /dev/null +++ b/.gitignore @@ -0,0 +1,73 @@ +## Build output +bin/ +obj/ +out/ +artifacts/ + +## Visual Studio / JetBrains Rider / VS Code +.vs/ +.idea/ +*.suo +*.user +*.userosscache +*.sln.docstates + +## NuGet +*.nupkg +*.snupkg +packages/ +.nuget/ +**/project.lock.json +**/project.fragment.lock.json +**/artifacts/ + +## Logs +*.log +*.tlog + +## Cache +*.cache +*.db +*.db-shm +*.db-wal + +## Backup files +*.bak +*.orig + +## OS junk +.DS_Store +Thumbs.db +ehthumbs.db +Desktop.ini + +## ASP.NET / IIS (if added later) +App_Data/ +*.pubxml +*.publishsettings + +## dotnet user secrets +**/secrets.json +*.secret + +## .NET generated +*.deps.json +*.runtimeconfig.json +*.runtimeconfig.dev.json + +## F# specific +*.fsi +*.fsjs + +## Rider +.idea/ +*.DotSettings.user + +## VS Code +.vscode/ +.history/ + +## JetBrains / ReSharper +_ReSharper.Caches/ +_ReSharper*/ +*.DotSettings.user diff --git a/TuneBladeFixer.sln b/TuneBladeFixer.sln new file mode 100644 index 0000000..322a7b0 --- /dev/null +++ b/TuneBladeFixer.sln @@ -0,0 +1,16 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "TuneBladeFixer", "TuneBladeFixer\TuneBladeFixer.fsproj", "{32FAC1E4-2EE4-4365-8185-8732F70E983B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {32FAC1E4-2EE4-4365-8185-8732F70E983B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {32FAC1E4-2EE4-4365-8185-8732F70E983B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {32FAC1E4-2EE4-4365-8185-8732F70E983B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {32FAC1E4-2EE4-4365-8185-8732F70E983B}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/TuneBladeFixer/Program.fs b/TuneBladeFixer/Program.fs new file mode 100644 index 0000000..ac78298 --- /dev/null +++ b/TuneBladeFixer/Program.fs @@ -0,0 +1,45 @@ +open System +open System.Runtime.InteropServices +open System.Text + +[] +extern IntPtr FindWindow(string lpClassName, string lpWindowName) + +[] +extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow) + +[] +extern int GetClassName(IntPtr hWnd, StringBuilder lpClassName, int nMaxCount) + +[] +extern bool PostMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam) + +let WM_CLOSE = 0x0010u + +let getClassName (hWnd: IntPtr) = + let sb = StringBuilder(256) + if GetClassName(hWnd, sb, sb.Capacity) > 0 then + sb.ToString() + else + "" + +[] +let main _ = + printfn "Running TuneBlade error suppressor..." + while true do + let hwnd = FindWindow(null, "TuneBlade") + + if hwnd <> IntPtr.Zero then + let cls = getClassName hwnd + if cls = "#32770" then + printfn "TuneBlade error dialog detected — closing." + PostMessage(hwnd, WM_CLOSE, IntPtr.Zero, IntPtr.Zero) |> ignore + + let mutable child = FindWindowEx(IntPtr.Zero, IntPtr.Zero, "#32770", "TuneBlade") + while child <> IntPtr.Zero do + printfn "Closing TuneBlade dialog window..." + PostMessage(child, WM_CLOSE, IntPtr.Zero, IntPtr.Zero) |> ignore + child <- FindWindowEx(IntPtr.Zero, child, "#32770", "TuneBlade") + + System.Threading.Thread.Sleep(2000) + 0 diff --git a/TuneBladeFixer/TuneBladeFixer.fsproj b/TuneBladeFixer/TuneBladeFixer.fsproj new file mode 100644 index 0000000..dadc839 --- /dev/null +++ b/TuneBladeFixer/TuneBladeFixer.fsproj @@ -0,0 +1,12 @@ + + + + Exe + net9.0 + + + + + + +