>>228
WindowsFormsあたり使えばできるんじゃないの?と思ってCopilotに聞いてみた

Add-Type -TypeDefinition @"
using System;
using System.Runtime.InteropServices;

public class ImeControl {
[DllImport("user32.dll")]
public static extern IntPtr GetForegroundWindow();

[DllImport("user32.dll")]
public static extern int ImmAssociateContext(IntPtr hWnd, IntPtr hIMC);

public static void DisableImeMode() {
IntPtr hWnd = GetForegroundWindow();
ImmAssociateContext(hWnd, IntPtr.Zero);
}
}
"@

思ってたんと違った