Windows Mobile 6 - Is it possible to programmatically access the word completion dictionary
I would like to be able to programmatically control the word completion list for a particular textbox in my windows mobile application. Does anyone know if this is possi开发者_开发百科ble and if so how would this be done?
You can turn these elements on and off with a p/invoke call. See below:
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);
}
}
You can then define what controls you want to control the functionality with by passing the handle:
InputContext.SetAutoSuggestion(txtBxInput.Handle, false);
精彩评论