We are looking into how we can check the spelli开发者_StackOverflow中文版ng of text entered by the user in an app we have developed.
Is there any standard APIs and libraries/dictionaries included in the Windows Mobile 6.x OS that can be used for this? Please point me in the rigth direction if there is.
Thank you in advance!
Windows Mobile 6 has Auto Correction and Auto Suggestion built in. You can enable and disable these from your app with the following PInvoke call.
public static class InputContext
{
private enum SHIC_FEATURE : uint
{
RESTOREDEFAULT = 0,
AUTOCORRECT = 1,
AUTOSUGGEST = 2,
HAVETRAILER = 3,
CLASS = 4
}
[DllImport("aygshell.dll")]
private static extern int SHSetInputContext(IntPtr hwnd, SHIC_FEATURE dwFeature, ref bool lpValue);
public static void SetAutoSuggestion(IntPtr handle, bool enable)
{
SHSetInputContext(handle, SHIC_FEATURE.AUTOSUGGEST, ref enable);
SHSetInputContext(handle, SHIC_FEATURE.AUTOCORRECT, ref enable);
}
}
精彩评论