IEnumTfLanguageProfiles = interface
['{3D61BF11-AC5F-42C8-A4CB-931BCC28C744}']
function Next(ulCount: Cardinal; const pProfile: PF_LANGUAGEPROFILE; out pcFetch: Cardinal): HRESULT; stdcall;
MSDN
HRESULT Next( ULONG ulCount<!---->,
TF_LANGUAGEPROFILE* pProfile<!---->,
ULONG* pcFetch<!----> );
Parameters
ulCount
[in] Specifies the number of elements to obtain.
pProfile
[out] Pointer to an array of TF_LANGUAGEPROFILE structures that receives the requested data. This array must be at least ulCount elements in size.
pcFetch
[out] Pointer to a ULONG value that receives the number of elements obtained. This value can be less than the number of items requested. This parameter can be NULL.
Next(int count, [Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)]
TF_LANGUAGEPROFILE[] profiles, out int fetched);
type
PF_LANGUAGEPROFILE = ^TF_LANGUAGEPROFILE;
TF_LANGUAGEPROFILE = packed record
clsid: TGUID;
langid: smallint;
catid: TGUID;
fActive: WordBool;
guidProfile: TGUID;
end;
IEnumGUID = interface
['{0002E000-0000-0000-C000-000000000046}']
function Next(celt: Cardinal; out rgelt: TGUID; out pcFetched: Cardinal): HRESULT; stdcall;
function Skip(celt: Cardinal): HRESULT; stdcall;
function Reset: HRESULT; stdcall;
function Clone(out ppEnum: IEnumGUID): HRESULT; stdcall;
end;
IEnumTfLanguageProfiles = interface
['{3D61BF11-AC5F-42C8-A4CB-931BCC28C744}']
function Clone(out ppEnum: IEnumTfLanguageProfiles): HRESULT; stdcall;
function Next(ulCount: Cardinal; const pProfile: PF_LANGUAGEPROFILE; out pcFetch: Cardinal): HRESULT; stdcall;
function Reset: HRESULT; stdcall;
function Skip(ulCount: Cardinal): HRESULT; stdcall;
end;
ITfInputProcessorProfiles = interface
['{1F02B6C5-7842-4EE6-8A0B-9A24183A95CA}']
function Register(const clsid: TGUID): HRESULT; stdcall;
function Unregister(const clsid: TGUID): HRESULT; stdcall;
function AddLanguageProfile(const clsid: TGUID; langid: smallint; const guidProfile: TGUID; const pchDesc: WideString; cchDesc: Cardinal; const pchIconFile: WideString; cchFile, uIconIndex: Cardinal): HRESULT; stdcall;
function RemoveLanguageProfile(const clsid: TGUID; langid: smallint; out guidProfile: TGUID): HRESULT; stdcall;
function EnumInputProcessorInfo(out ppEnum: IEnumGUID): HRESULT; stdcall;
function GetDefaultLanguageProfile(langid: smallint; const catid: TGUID; out clsid: TGUID; out guidProfile: TGUID): HRESULT; stdcall;
function SetDefaultLanguageProfile(langid: smallint; const clsid: TGUID; const guidProfile: TGUID): HRESULT; stdcall;
function ActivateLanguageProfile(const clsid: TGUID; langid: smallint; const guidProfiles: TGUID): HRESULT; stdcall;
function GetActiveLanguageProfile(const clsid: TGUID; out langid: smallint; out guidProfile: TGUID): HRESULT; stdcall;
function GetLanguageProfileDescription(const clsid: TGUID; langid: smallint; const guidProfile: TGUID; out pbstrProfile: WideString): HRESULT; stdcall;
function GetCurrentLanguage(out langid: smallint): HRESULT; stdcall;
function ChangeCurrentLanguage(langid: smallint): HRESULT; stdcall;
function GetLanguageList(out ppLangId: pointer; out ulCount: Cardinal): HRESULT; stdcall;
function EnumLanguageProfiles(langid: smallint; out ppEnum: IEnumTfLanguageProfiles): HRESULT; stdcall;
function EnableLanguageProfile(const clsid: TGUID; langid: smallint; const guidProfile: TGUID; fEnable: WordBool): HRESULT; stdcall;
function IsEnabledLanguageProfile(const clsid: TGUID; langid: smallint; const guidProfile: TGUID; out fEnabled: WordBool): HRESULT; stdcall;
function EnableLanguageProfileByDefault(const clsid: TGUID; langid: smallint; const guidProfile: TGUID; fEnabled: WordBool): HRESULT; stdcall;
function SubstituteKeyboardLayout(const clsid: TGUID; langid: smallint; const guidProfile: TGUID; hKL: pointer): HRESULT; stdcall;
end;
function TF_CreateInputProcessorProfiles(out profiles: ITfInputProcessorProfiles): HRESULT; stdcall; external 'msctf.dll';
https://github.com/ryancheung/ImeSharp
IterateSubKeys(Registry.CurrentUser, "SOFTWARE\\Microsoft\\CTF\\TIP\\" + subKeyName + "\\LanguageProfile",
https://www.xujun.org/note-48842.html
文/黄忠成
[ ComImport , SecurityCritical , SuppressUnmanagedCodeSecurity ,
//L"MSIME.Japan";
//L"MSIME.Taiwan";
//L"MSIME.Taiwan.ImeBbo";
imm.h
immdev.h
msime.h
msimeapi.h
ctffunc.h
ctfspui.h
ctfutb.h
inputscope.h
msaatext.h
msctf.h
沒有留言:
張貼留言