Text Prediction how to turn off

  • Thread starter Thread starter WM Developer
  • Start date Start date
On Smartphone/Standard Edition devices you can use the
Microsoft.WindowsCE.Forms.InputModeEditor class to set the mode for specific
controls. Setting this to AlphaABC rather than AlphaT9 or AlphaCurrent will
ensure that standard alpha multi-tap for numerical keypads) is used.

Peter

--
Peter Foot
Microsoft Device Application Development MVP
peterfoot.net | appamundi.com | inthehand.com
APPA Mundi Ltd - software solutions for a mobile world
In The Hand Ltd - .NET Components for Mobility
 
On Smartphone/Standard Edition devices you can use the
Microsoft.WindowsCE.Forms.InputModeEditor class to set the mode for specific
controls. Setting this to AlphaABC rather than AlphaT9 or AlphaCurrent will
ensure that standard alpha multi-tap for numerical keypads) is used.

Hello Peter,

i want to do this on a windows mobile 6.1 professional device. Is it
possible to turn off text prediction on this device?

Regards, Verena
 
On Professional predictive text is an OEM option and doesn't appear to be
specific to the chosen SIP (Software Input Panel). On my HTC Touch, for
example, prediction is displayed even with the standard keyboard SIP.
It may be possible there is a registry setting to disable this but it will
be a device/manufacturer specific thing, not a standard location for all WM
Professional devices.

Peter

--
Peter Foot
Microsoft Device Application Development MVP
peterfoot.net | appamundi.com | inthehand.com
APPA Mundi Ltd - software solutions for a mobile world
In The Hand Ltd - .NET Components for Mobility
 
This does not appear to be working. My device is a Windows Mobile 6 Classic
device; Hp iPAQ 110 ClassicHandheld. Predictive text may be a feature but
mostly an annoyance. Can it not be disabled?
 
Hi,

Peter Foot said:
On Professional predictive text is an OEM option and doesn't appear to be
specific to the chosen SIP (Software Input Panel). On my HTC Touch, for
example, prediction is displayed even with the standard keyboard SIP.
It may be possible there is a registry setting to disable this but it will
be a device/manufacturer specific thing, not a standard location for all
WM Professional devices.

The standard API for trying to enable/disable this feature is
SHSetInputContext (with the SHIC_FEATURE_AUTOSUGGEST) flag. See
http://msdn.microsoft.com/en-us/library/ms840192.aspx for documentation.

You can Platform Invoke this API with the following declarations:

[DllImport("aygshell.dll", EntryPoint="SHSetInputContext")]
private static extern int SHSetInputContext(IntPtr hwnd, SHIC_FEATURE
dwFeature, object lpValue);

private enum SHIC_FEATURE : uint
{
RESTOREDEFAULT = 0,
AUTOCORRECT = 1,
AUTOSUGGEST = 2,
HAVETRAILER = 3,
CLASS = 4
};

public static void SetAutoSuggest(Control window, bool enabled)
{
SHSetInputContext(window.Handle, SHIC_FEATURE.AUTOSUGGEST, ref enabled);
}

Once this is done you can disable auto suggestion for a given text box by
using a code snippet similiar to the following

SetAutoSuggest(textBox1, false);

This works with the emulators and various devices I have tried it on while
using the standard keyboard SIP. However your milage may vary with certain
devices or other software input panels. Some IMEs and SIPs implemented by
OEMs do not observe these flags and/or implement their auto
suggestion/correction features in a manor not compatible with this API.

Other features of this API are definatly worth a look at as well. For
example the SHIC_FEATURE_CLASS option can be used to perform some extra
magic if you're needing the user to type in the name of a contact present
within Pocket Outlook's contact database (such as suggesting the persons's
name when the user starts typing the contact's email address etc).

Hope this helps,
Christopher Fairbairn
 
I've never found these to work (at least as expected) on the devices I've
tried but nice to hear they are at least implemented on some!

Peter

Christopher Fairbairn said:
Hi,

Peter Foot said:
On Professional predictive text is an OEM option and doesn't appear to be
specific to the chosen SIP (Software Input Panel). On my HTC Touch, for
example, prediction is displayed even with the standard keyboard SIP.
It may be possible there is a registry setting to disable this but it
will be a device/manufacturer specific thing, not a standard location for
all WM Professional devices.

The standard API for trying to enable/disable this feature is
SHSetInputContext (with the SHIC_FEATURE_AUTOSUGGEST) flag. See
http://msdn.microsoft.com/en-us/library/ms840192.aspx for documentation.

You can Platform Invoke this API with the following declarations:

[DllImport("aygshell.dll", EntryPoint="SHSetInputContext")]
private static extern int SHSetInputContext(IntPtr hwnd, SHIC_FEATURE
dwFeature, object lpValue);

private enum SHIC_FEATURE : uint
{
RESTOREDEFAULT = 0,
AUTOCORRECT = 1,
AUTOSUGGEST = 2,
HAVETRAILER = 3,
CLASS = 4
};

public static void SetAutoSuggest(Control window, bool enabled)
{
SHSetInputContext(window.Handle, SHIC_FEATURE.AUTOSUGGEST, ref enabled);
}

Once this is done you can disable auto suggestion for a given text box by
using a code snippet similiar to the following

SetAutoSuggest(textBox1, false);

This works with the emulators and various devices I have tried it on while
using the standard keyboard SIP. However your milage may vary with certain
devices or other software input panels. Some IMEs and SIPs implemented by
OEMs do not observe these flags and/or implement their auto
suggestion/correction features in a manor not compatible with this API.

Other features of this API are definatly worth a look at as well. For
example the SHIC_FEATURE_CLASS option can be used to perform some extra
magic if you're needing the user to type in the name of a contact present
within Pocket Outlook's contact database (such as suggesting the persons's
name when the user starts typing the contact's email address etc).

Hope this helps,
Christopher Fairbairn
 
Got syntax error -- Error 18 Argument '3': cannot convert from 'ref bool' to
'object'.
public static void SetAutoSuggest(Control window, bool enabled)
{
SHSetInputContext(window.Handle, SHIC_FEATURE.AUTOSUGGEST, enabled);
--------------------------------------------------------------------------------------^^^^^
}

Christopher Fairbairn said:
Hi,

Peter Foot said:
On Professional predictive text is an OEM option and doesn't appear to be
specific to the chosen SIP (Software Input Panel). On my HTC Touch, for
example, prediction is displayed even with the standard keyboard SIP.
It may be possible there is a registry setting to disable this but it will
be a device/manufacturer specific thing, not a standard location for all
WM Professional devices.

The standard API for trying to enable/disable this feature is
SHSetInputContext (with the SHIC_FEATURE_AUTOSUGGEST) flag. See
http://msdn.microsoft.com/en-us/library/ms840192.aspx for documentation.

You can Platform Invoke this API with the following declarations:

[DllImport("aygshell.dll", EntryPoint="SHSetInputContext")]
private static extern int SHSetInputContext(IntPtr hwnd, SHIC_FEATURE
dwFeature, object lpValue);

private enum SHIC_FEATURE : uint
{
RESTOREDEFAULT = 0,
AUTOCORRECT = 1,
AUTOSUGGEST = 2,
HAVETRAILER = 3,
CLASS = 4
};

public static void SetAutoSuggest(Control window, bool enabled)
{
SHSetInputContext(window.Handle, SHIC_FEATURE.AUTOSUGGEST, ref enabled);
}

Once this is done you can disable auto suggestion for a given text box by
using a code snippet similiar to the following

SetAutoSuggest(textBox1, false);

This works with the emulators and various devices I have tried it on while
using the standard keyboard SIP. However your milage may vary with certain
devices or other software input panels. Some IMEs and SIPs implemented by
OEMs do not observe these flags and/or implement their auto
suggestion/correction features in a manor not compatible with this API.

Other features of this API are definatly worth a look at as well. For
example the SHIC_FEATURE_CLASS option can be used to perform some extra
magic if you're needing the user to type in the name of a contact present
within Pocket Outlook's contact database (such as suggesting the persons's
name when the user starts typing the contact's email address etc).

Hope this helps,
Christopher Fairbairn
 
Sure, the P/Invoke declaration and the calling code quite obviously don't
match. Christopher certainly gave you enough info to get 99% of the way
there, all you have to do is either fix the caller or the P/Invoke
declaration (I'd likely change the latter).


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com


WM Developer said:
Got syntax error -- Error 18 Argument '3': cannot convert from 'ref bool'
to
'object'.
public static void SetAutoSuggest(Control window, bool enabled)
{
SHSetInputContext(window.Handle, SHIC_FEATURE.AUTOSUGGEST, enabled);
--------------------------------------------------------------------------------------^^^^^
}

Christopher Fairbairn said:
Hi,

Peter Foot said:
On Professional predictive text is an OEM option and doesn't appear to
be
specific to the chosen SIP (Software Input Panel). On my HTC Touch, for
example, prediction is displayed even with the standard keyboard SIP.
It may be possible there is a registry setting to disable this but it
will
be a device/manufacturer specific thing, not a standard location for
all
WM Professional devices.

The standard API for trying to enable/disable this feature is
SHSetInputContext (with the SHIC_FEATURE_AUTOSUGGEST) flag. See
http://msdn.microsoft.com/en-us/library/ms840192.aspx for documentation.

You can Platform Invoke this API with the following declarations:

[DllImport("aygshell.dll", EntryPoint="SHSetInputContext")]
private static extern int SHSetInputContext(IntPtr hwnd, SHIC_FEATURE
dwFeature, object lpValue);

private enum SHIC_FEATURE : uint
{
RESTOREDEFAULT = 0,
AUTOCORRECT = 1,
AUTOSUGGEST = 2,
HAVETRAILER = 3,
CLASS = 4
};

public static void SetAutoSuggest(Control window, bool enabled)
{
SHSetInputContext(window.Handle, SHIC_FEATURE.AUTOSUGGEST, ref
enabled);
}

Once this is done you can disable auto suggestion for a given text box by
using a code snippet similiar to the following

SetAutoSuggest(textBox1, false);

This works with the emulators and various devices I have tried it on
while
using the standard keyboard SIP. However your milage may vary with
certain
devices or other software input panels. Some IMEs and SIPs implemented by
OEMs do not observe these flags and/or implement their auto
suggestion/correction features in a manor not compatible with this API.

Other features of this API are definatly worth a look at as well. For
example the SHIC_FEATURE_CLASS option can be used to perform some extra
magic if you're needing the user to type in the name of a contact present
within Pocket Outlook's contact database (such as suggesting the
persons's
name when the user starts typing the contact's email address etc).

Hope this helps,
Christopher Fairbairn
 
This code did not work for me. I am using windows mobile 6 professional
device. here is what I entered for code;

// Native Code
[DllImport("aygshell.dll", EntryPoint = "SHSetInputContext")]
private static extern int SHSetInputContext(IntPtr hwnd, SHIC_FEATURE
dwFeature, IntPtr lpValue);

private enum SHIC_FEATURE : uint {
RESTOREDEFAULT = 0, AUTOCORRECT = 1, AUTOSUGGEST = 2, HAVETRAILER = 3,
CLASS = 4};

public static void SetAutoSuggest(Control win, bool enabled) {
IntPtr value = new IntPtr(Convert.ToUInt32(enabled));
SHSetInputContext(win.Handle, SHIC_FEATURE.AUTOSUGGEST, value);
}
// usage:
SetAutoSuggest(textBox, false);


Any ideas? Is this because Windows Classic 6 devices can not modify this
feature programmatically?
Christopher Fairbairn said:
Hi,

Peter Foot said:
On Professional predictive text is an OEM option and doesn't appear to be
specific to the chosen SIP (Software Input Panel). On my HTC Touch, for
example, prediction is displayed even with the standard keyboard SIP.
It may be possible there is a registry setting to disable this but it will
be a device/manufacturer specific thing, not a standard location for all
WM Professional devices.

The standard API for trying to enable/disable this feature is
SHSetInputContext (with the SHIC_FEATURE_AUTOSUGGEST) flag. See
http://msdn.microsoft.com/en-us/library/ms840192.aspx for documentation.

You can Platform Invoke this API with the following declarations:

[DllImport("aygshell.dll", EntryPoint="SHSetInputContext")]
private static extern int SHSetInputContext(IntPtr hwnd, SHIC_FEATURE
dwFeature, object lpValue);

private enum SHIC_FEATURE : uint
{
RESTOREDEFAULT = 0,
AUTOCORRECT = 1,
AUTOSUGGEST = 2,
HAVETRAILER = 3,
CLASS = 4
};

public static void SetAutoSuggest(Control window, bool enabled)
{
SHSetInputContext(window.Handle, SHIC_FEATURE.AUTOSUGGEST, ref enabled);
}

Once this is done you can disable auto suggestion for a given text box by
using a code snippet similiar to the following

SetAutoSuggest(textBox1, false);

This works with the emulators and various devices I have tried it on while
using the standard keyboard SIP. However your milage may vary with certain
devices or other software input panels. Some IMEs and SIPs implemented by
OEMs do not observe these flags and/or implement their auto
suggestion/correction features in a manor not compatible with this API.

Other features of this API are definatly worth a look at as well. For
example the SHIC_FEATURE_CLASS option can be used to perform some extra
magic if you're needing the user to type in the name of a contact present
within Pocket Outlook's contact database (such as suggesting the persons's
name when the user starts typing the contact's email address etc).

Hope this helps,
Christopher Fairbairn
 
Hi,

WM Developer said:
This code did not work for me. I am using windows mobile 6 professional
device. here is what I entered for code;

Using IntPtr like that isn't the correct way to define the API. The native
side of things won't be getting the parameters in the form it expects.

Sorry about the copy and paste error I made during my original post. I was
attempting to extract the code from a larger code base to show only the
specific bits you required and in the process made some rather obvious
mistakes while simplifying the code snippet. That will teach me to code
within my newsgroup client directly again without at least putting it
through the compiler :-)

Try the following:

public static void SetAutoSuggest(Control window, bool enabled) {
SHSetInputContext(window.Handle, SHIC_FEATURE.AUTOSUGGEST, ref enabled);
}

[DllImport("aygshell.dll")]
private static extern int SHSetInputContext(IntPtr hwnd,
SHIC_FEATURE dwFeature,
[MarshalAs(UnmanagedType.Bool)]ref bool lpValue);

private enum SHIC_FEATURE : uint {
RESTOREDEFAULT = 0,
AUTOCORRECT = 1,
AUTOSUGGEST = 2,
HAVETRAILER = 3,
CLASS = 4
};

As Peter suggested, your milage may vary. There are a lot of moving parts
which can affect this behaviour, but it does work on a range of physical
devices (including one from the HP range you mention you are using) that I
have access to as well as the emulators that come with the WM 6 SDK.

Hope this helps,
Christopher Fairbairn
 
If the call wants a BOOL, just pass it a bool.

Paul T.

WM Developer said:
This code did not work for me. I am using windows mobile 6 professional
device. here is what I entered for code;

// Native Code
[DllImport("aygshell.dll", EntryPoint = "SHSetInputContext")]
private static extern int SHSetInputContext(IntPtr hwnd, SHIC_FEATURE
dwFeature, IntPtr lpValue);

private enum SHIC_FEATURE : uint {
RESTOREDEFAULT = 0, AUTOCORRECT = 1, AUTOSUGGEST = 2, HAVETRAILER = 3,
CLASS = 4};

public static void SetAutoSuggest(Control win, bool enabled) {
IntPtr value = new IntPtr(Convert.ToUInt32(enabled));
SHSetInputContext(win.Handle, SHIC_FEATURE.AUTOSUGGEST, value);
}
// usage:
SetAutoSuggest(textBox, false);


Any ideas? Is this because Windows Classic 6 devices can not modify this
feature programmatically?
Christopher Fairbairn said:
Hi,

Peter Foot said:
On Professional predictive text is an OEM option and doesn't appear to
be
specific to the chosen SIP (Software Input Panel). On my HTC Touch, for
example, prediction is displayed even with the standard keyboard SIP.
It may be possible there is a registry setting to disable this but it
will
be a device/manufacturer specific thing, not a standard location for
all
WM Professional devices.

The standard API for trying to enable/disable this feature is
SHSetInputContext (with the SHIC_FEATURE_AUTOSUGGEST) flag. See
http://msdn.microsoft.com/en-us/library/ms840192.aspx for documentation.

You can Platform Invoke this API with the following declarations:

[DllImport("aygshell.dll", EntryPoint="SHSetInputContext")]
private static extern int SHSetInputContext(IntPtr hwnd, SHIC_FEATURE
dwFeature, object lpValue);

private enum SHIC_FEATURE : uint
{
RESTOREDEFAULT = 0,
AUTOCORRECT = 1,
AUTOSUGGEST = 2,
HAVETRAILER = 3,
CLASS = 4
};

public static void SetAutoSuggest(Control window, bool enabled)
{
SHSetInputContext(window.Handle, SHIC_FEATURE.AUTOSUGGEST, ref
enabled);
}

Once this is done you can disable auto suggestion for a given text box by
using a code snippet similiar to the following

SetAutoSuggest(textBox1, false);

This works with the emulators and various devices I have tried it on
while
using the standard keyboard SIP. However your milage may vary with
certain
devices or other software input panels. Some IMEs and SIPs implemented by
OEMs do not observe these flags and/or implement their auto
suggestion/correction features in a manor not compatible with this API.

Other features of this API are definatly worth a look at as well. For
example the SHIC_FEATURE_CLASS option can be used to perform some extra
magic if you're needing the user to type in the name of a contact present
within Pocket Outlook's contact database (such as suggesting the
persons's
name when the user starts typing the contact's email address etc).

Hope this helps,
Christopher Fairbairn
 
Actually that's not safe unless you give it a marshaling hint (i.e.
MarshalAs). Managed bool and native BOOL are different size (and I've been
bitten by that before).


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com

"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:[email protected]...
If the call wants a BOOL, just pass it a bool.

Paul T.

WM Developer said:
This code did not work for me. I am using windows mobile 6 professional
device. here is what I entered for code;

// Native Code
[DllImport("aygshell.dll", EntryPoint = "SHSetInputContext")]
private static extern int SHSetInputContext(IntPtr hwnd, SHIC_FEATURE
dwFeature, IntPtr lpValue);

private enum SHIC_FEATURE : uint {
RESTOREDEFAULT = 0, AUTOCORRECT = 1, AUTOSUGGEST = 2, HAVETRAILER = 3,
CLASS = 4};

public static void SetAutoSuggest(Control win, bool enabled) {
IntPtr value = new IntPtr(Convert.ToUInt32(enabled));
SHSetInputContext(win.Handle, SHIC_FEATURE.AUTOSUGGEST, value);
}
// usage:
SetAutoSuggest(textBox, false);


Any ideas? Is this because Windows Classic 6 devices can not modify this
feature programmatically?
Christopher Fairbairn said:
Hi,

On Professional predictive text is an OEM option and doesn't appear to
be
specific to the chosen SIP (Software Input Panel). On my HTC Touch,
for
example, prediction is displayed even with the standard keyboard SIP.
It may be possible there is a registry setting to disable this but it
will
be a device/manufacturer specific thing, not a standard location for
all
WM Professional devices.

The standard API for trying to enable/disable this feature is
SHSetInputContext (with the SHIC_FEATURE_AUTOSUGGEST) flag. See
http://msdn.microsoft.com/en-us/library/ms840192.aspx for documentation.

You can Platform Invoke this API with the following declarations:

[DllImport("aygshell.dll", EntryPoint="SHSetInputContext")]
private static extern int SHSetInputContext(IntPtr hwnd, SHIC_FEATURE
dwFeature, object lpValue);

private enum SHIC_FEATURE : uint
{
RESTOREDEFAULT = 0,
AUTOCORRECT = 1,
AUTOSUGGEST = 2,
HAVETRAILER = 3,
CLASS = 4
};

public static void SetAutoSuggest(Control window, bool enabled)
{
SHSetInputContext(window.Handle, SHIC_FEATURE.AUTOSUGGEST, ref
enabled);
}

Once this is done you can disable auto suggestion for a given text box
by
using a code snippet similiar to the following

SetAutoSuggest(textBox1, false);

This works with the emulators and various devices I have tried it on
while
using the standard keyboard SIP. However your milage may vary with
certain
devices or other software input panels. Some IMEs and SIPs implemented
by
OEMs do not observe these flags and/or implement their auto
suggestion/correction features in a manor not compatible with this API.

Other features of this API are definatly worth a look at as well. For
example the SHIC_FEATURE_CLASS option can be used to perform some extra
magic if you're needing the user to type in the name of a contact
present
within Pocket Outlook's contact database (such as suggesting the
persons's
name when the user starts typing the contact's email address etc).

Hope this helps,
Christopher Fairbairn
 
Yep, that's what I've been doing (MarshalAs). Should have mentioned that.

Paul T.

Chris Tacke said:
Actually that's not safe unless you give it a marshaling hint (i.e.
MarshalAs). Managed bool and native BOOL are different size (and I've
been bitten by that before).


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com

"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:[email protected]...
If the call wants a BOOL, just pass it a bool.

Paul T.

WM Developer said:
This code did not work for me. I am using windows mobile 6 professional
device. here is what I entered for code;

// Native Code
[DllImport("aygshell.dll", EntryPoint = "SHSetInputContext")]
private static extern int SHSetInputContext(IntPtr hwnd, SHIC_FEATURE
dwFeature, IntPtr lpValue);

private enum SHIC_FEATURE : uint {
RESTOREDEFAULT = 0, AUTOCORRECT = 1, AUTOSUGGEST = 2, HAVETRAILER =
3,
CLASS = 4};

public static void SetAutoSuggest(Control win, bool enabled) {
IntPtr value = new IntPtr(Convert.ToUInt32(enabled));
SHSetInputContext(win.Handle, SHIC_FEATURE.AUTOSUGGEST, value);
}
// usage:
SetAutoSuggest(textBox, false);


Any ideas? Is this because Windows Classic 6 devices can not modify
this
feature programmatically?
:

Hi,

On Professional predictive text is an OEM option and doesn't appear
to be
specific to the chosen SIP (Software Input Panel). On my HTC Touch,
for
example, prediction is displayed even with the standard keyboard SIP.
It may be possible there is a registry setting to disable this but it
will
be a device/manufacturer specific thing, not a standard location for
all
WM Professional devices.

The standard API for trying to enable/disable this feature is
SHSetInputContext (with the SHIC_FEATURE_AUTOSUGGEST) flag. See
http://msdn.microsoft.com/en-us/library/ms840192.aspx for
documentation.

You can Platform Invoke this API with the following declarations:

[DllImport("aygshell.dll", EntryPoint="SHSetInputContext")]
private static extern int SHSetInputContext(IntPtr hwnd, SHIC_FEATURE
dwFeature, object lpValue);

private enum SHIC_FEATURE : uint
{
RESTOREDEFAULT = 0,
AUTOCORRECT = 1,
AUTOSUGGEST = 2,
HAVETRAILER = 3,
CLASS = 4
};

public static void SetAutoSuggest(Control window, bool enabled)
{
SHSetInputContext(window.Handle, SHIC_FEATURE.AUTOSUGGEST, ref
enabled);
}

Once this is done you can disable auto suggestion for a given text box
by
using a code snippet similiar to the following

SetAutoSuggest(textBox1, false);

This works with the emulators and various devices I have tried it on
while
using the standard keyboard SIP. However your milage may vary with
certain
devices or other software input panels. Some IMEs and SIPs implemented
by
OEMs do not observe these flags and/or implement their auto
suggestion/correction features in a manor not compatible with this API.

Other features of this API are definatly worth a look at as well. For
example the SHIC_FEATURE_CLASS option can be used to perform some extra
magic if you're needing the user to type in the name of a contact
present
within Pocket Outlook's contact database (such as suggesting the
persons's
name when the user starts typing the contact's email address etc).

Hope this helps,
Christopher Fairbairn
 
Thanks, that worked!

Christopher Fairbairn said:
Hi,

WM Developer said:
This code did not work for me. I am using windows mobile 6 professional
device. here is what I entered for code;

Using IntPtr like that isn't the correct way to define the API. The native
side of things won't be getting the parameters in the form it expects.

Sorry about the copy and paste error I made during my original post. I was
attempting to extract the code from a larger code base to show only the
specific bits you required and in the process made some rather obvious
mistakes while simplifying the code snippet. That will teach me to code
within my newsgroup client directly again without at least putting it
through the compiler :-)

Try the following:

public static void SetAutoSuggest(Control window, bool enabled) {
SHSetInputContext(window.Handle, SHIC_FEATURE.AUTOSUGGEST, ref enabled);
}

[DllImport("aygshell.dll")]
private static extern int SHSetInputContext(IntPtr hwnd,
SHIC_FEATURE dwFeature,
[MarshalAs(UnmanagedType.Bool)]ref bool lpValue);

private enum SHIC_FEATURE : uint {
RESTOREDEFAULT = 0,
AUTOCORRECT = 1,
AUTOSUGGEST = 2,
HAVETRAILER = 3,
CLASS = 4
};

As Peter suggested, your milage may vary. There are a lot of moving parts
which can affect this behaviour, but it does work on a range of physical
devices (including one from the HP range you mention you are using) that I
have access to as well as the emulators that come with the WM 6 SDK.

Hope this helps,
Christopher Fairbairn
 
Back
Top