You can use the method provided by. Net CF itself to enumerate all the SIP messages on the device. See: http://msdn.microsoft.com/en-us/library/ms172538.aspx // Define an inputpanel
Private Inputpanel m_inputpanel = New Inputpanel ();
// Enumerative sip
Foreach (Inputmethod Method In M_inputpanel.inputmethods)
{
This . ListBox. Items. Add (method. Name );
}
After enumerating all the SIP devices through the above method, you can choose your desired sip reference: http://msdn.microsoft.com/en-us/library/microsoft.windowsce.forms.inputpanel.currentinputmethod.aspx Private Void Setnewsip ( String Sipname)
{
Foreach (Inputmethod Method In M_inputpanel.inputmethods)
{
If (Sipname. Equals (method. Name ))
{
M_inputpanel.currentinputmethod = Method;
Break ;
}
}
} Reference: http://www.developer.com/ws/pc/article.php/10947_3583686_1/Managing-the-Software-Input-Panel-in-Your-Applications.htmhttp://www.pcreview.co.uk/forums/thread-2610504.php
Ask: I want the P/invoke system API to implement the. NET CF enumeration function for us, as follows: Code But it always returns 0, that is, it is not enumerated. Is it my structure parameter setting error or something else? Public Class Sipmanager
{
Public Delegate Int Imenumproc ( Ref Imenuminfo iminfo );
[Dllimport ( " Coredll. dll " )]
Public Static Extern Int Sipenumim (imenumproc enumimproc );
Private List < Imenuminfo > Sips = New List < Imenuminfo > ();
Public int sipenumimproc ( ref imenuminfo iminfo)
{< br> sips. add (iminfo);
return 1 ;
}
PublicList<Imenuminfo>Getsips ()
{
IntImcount=Sipenumim (sipenumimproc );
ReturnSIPs;
}
Public Class Imenuminfo
{
Public Stringbuilder szname;
Public Guid CLSID;
Public Imenuminfo ()
{
Szname = New Stringbuilder ();
CLSID = New GUID ();
}
}
}
// Call
Sipmanager sipmgr = New Sipmanager ();
List < Sipmanager. imenuminfo > List = New List < Sipmanager. imenuminfo > ();
List = Sipmgr. getsips ();
//However, after each trace is added to getsips, The imcount returned value is always 0, indicating that the request failed.
--------------------------------------------------
Lee Sen-Listen E-mail: lisencool@gmail.com |
Statement: Here we focus onWinCEAndWindows MobileSome basic knowledge in development. I would like to share with you, and I hope you will give your comments and contribute to me. I will post your name for you as soon as possible! Announce: Here collects general knowledge on WinCE and Windows Mobile. i'm very gglad to share them with all friends, and also hope you can share your problems and opinions and contribute articles to me to share with others. i'll publish your articles and sign your name at the first time. |