C♯相談室 Part19

このエントリーをはてなブックマークに追加
503468

//The Function to delete resiterd word
[DllImport("imm32",CharSet=CharSet.Auto)]
public static extern bool ImmUnregisterWord(IntPtr hKL, String lpszReading, UInt32 dwStyle, String lpszUnregister);

//The Function to Get ForeGround Window
[DllImport("user32",CharSet=CharSet.Auto)]
public static extern IntPtr GetForegroundWindow();

//The Function to Get Keyboard Layout
[DllImport("user32",CharSet=CharSet.Auto)]
public static extern IntPtr GetKeyboardLayout(UInt32 dwLayout);


//The struct field used for "ImmGetRegisterWordStyle"
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
public struct StyleBuffer
{
public UInt32 Style;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=0x20)]
public string Description;
public override string ToString()
{
return string.Format("StyleID: 0x{0:X8} 品詞: {1}", Style, Description);
}
}