public WinKeyboardAdaptor() { try { ProcessorProfiles = new TfInputProcessorProfilesClass(); } catch (InvalidCastException) { ProcessorProfiles = null; return; } // ProfileMgr will be null on Windows XP - the interface got introduced in Vista ProfileMgr = ProcessorProfiles as ITfInputProcessorProfileMgr; }
public static void RegisterProfiles() { var pITfInputProcessorProfileMgr = new ITfInputProcessorProfileMgr(); var iconFile = System.Reflection.Assembly.GetExecutingAssembly().Location; pITfInputProcessorProfileMgr.RegisterProfile( Globals.SampleIMECLSID, Globals.TEXTSERVICE_LANGID, Globals.SampleIMEGuidProfile, TEXTSERVICE_DESC.ToCharArray(), (uint)TEXTSERVICE_DESC.Length, iconFile.ToCharArray(), (uint)iconFile.Length, Globals.TEXTSERVICE_ICON_INDEX, (IntPtr)null, 0, true, 0); }
public static void UnregisterProfiles() { var pITfInputProcessorProfileMgr = new ITfInputProcessorProfileMgr(); pITfInputProcessorProfileMgr.UnregisterProfile(Globals.SampleIMECLSID, Globals.TEXTSERVICE_LANGID, Globals.SampleIMEGuidProfile, 0); }