|
知っているAPIでやってみたけど、Win8では駄目だった
[System.Runtime.InteropServices.DllImport("imm32.dll")]
extern static int ImmGetContext(IntPtr hwnd);
[System.Runtime.InteropServices.DllImport("imm32.dll")]
extern static bool ImmReleaseContext(IntPtr hwnd, int imc);
[System.Runtime.InteropServices.DllImport("imm32.dll")]
extern static bool ImmSetOpenStatus(int imc, bool isOpen);
[System.Runtime.InteropServices.DllImport("imm32.dll")]
extern static bool ImmGetConversionStatus(int imc, out uint conversion, out uint sentence);
[System.Runtime.InteropServices.DllImport("imm32.dll")]
extern static bool ImmSetConversionStatus(int imc, uint conversion, uint sentence);
private void textBox1_Enter(object sender, EventArgs e)
{
var imc = ImmGetContext(Handle);
ImmSetOpenStatus(imc, true);
uint conversion;
uint sentence;
ImmGetConversionStatus(imc, out conversion, out sentence);
conversion = conversion & 0xFFFFFF4 | 0x00000003;
ImmSetConversionStatus(imc, conversion, sentence);
ImmReleaseContext(Handle, imc);
}
|