|
Prev: Restarting message loop with new form after exception
Next: OpenNETCF Webbrowser or visualize a html-file
From: Manfred Denzer on 23 Jun 2008 08:27 Hello, I have a problem with the "Soft Input Panel" (SIP). Please have a look at this screenshot of my application: http://img517.imageshack.us/img517/668/sipproblemzu9.png I have an own button to show the SIP. But if a click on this button, a second default button appears. Is it possible to deactivate the default SIP button? And a second question: How can I check, if the SIP is currently shown or hide? Thank you very much for your help! Greetings, Manfred [DllImport("coredll.dll")] private static extern int SipShowIM(SIPStatus i); [DllImport("coredll.dll")] private static extern bool SipSetInfo(ref SIPINFO pSipInfo); [DllImport("coredll.dll")] private static extern bool SipGetInfo(ref SIPINFO pSipInfo); private enum SIPStatus { SIPF_OFF = 0, SIPF_ON = 1 } private struct SIPINFO { public Int32 cbSize; public Int32 fdwFlags; public RECT rcVisibleDesktop; public RECT rcSipRect; public Int32 dwImDataSize; public Int32 pvImData; } private struct RECT { public Int32 left; public Int32 top; public Int32 right; public Int32 bottom; } public Boolean isVisible() { return pvtVisible; } public void SetPosition(Int32 top) { SIPINFO mySi = new SIPINFO(); bool result = true; mySi.cbSize = System.Runtime.InteropServices.Marshal.SizeOf(typeof(SIPINFO)); result = SipGetInfo(ref mySi); mySi.rcSipRect.top = top; mySi.rcSipRect.bottom = top + 80; result = SipSetInfo(ref mySi); } public void show() { SipShowIM(SIPStatus.SIPF_ON); } public void hide() { SipShowIM(SIPStatus.SIPF_OFF); }
From: Peter Foot on 23 Jun 2008 12:22 You'll need to P/Invoke the SHFullScreen function. One of the flags you can pass in allows you to enable/disable the SIP button. You'll find you need to call this function any time the form is activated not just the first time you show it or the button will often creep back in. You should be able to find numerous P/Invoke definitions for this function either in the archives of this group or on the web. 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 "Manfred Denzer" <el.fleisch(a)googlemail.com> wrote in message news:01e98659-63a3-4af4-9d1d-71d12f5a710b(a)25g2000hsx.googlegroups.com... > Hello, > > I have a problem with the "Soft Input Panel" (SIP). Please have a look > at this screenshot of my application: > http://img517.imageshack.us/img517/668/sipproblemzu9.png > > I have an own button to show the SIP. But if a click on this button, a > second default button appears. Is it possible to deactivate the > default SIP button? > > And a second question: How can I check, if the SIP is currently shown > or hide? > > Thank you very much for your help! > Greetings, Manfred > > > > > [DllImport("coredll.dll")] > private static extern int SipShowIM(SIPStatus i); > [DllImport("coredll.dll")] > private static extern bool SipSetInfo(ref SIPINFO pSipInfo); > [DllImport("coredll.dll")] > private static extern bool SipGetInfo(ref SIPINFO pSipInfo); > > private enum SIPStatus > { > SIPF_OFF = 0, > SIPF_ON = 1 > } > private struct SIPINFO > { > public Int32 cbSize; > public Int32 fdwFlags; > public RECT rcVisibleDesktop; > public RECT rcSipRect; > public Int32 dwImDataSize; > public Int32 pvImData; > } > > private struct RECT > { > public Int32 left; > public Int32 top; > public Int32 right; > public Int32 bottom; > } > > public Boolean isVisible() { > return pvtVisible; > } > > public void SetPosition(Int32 top) > { > SIPINFO mySi = new SIPINFO(); > bool result = true; > mySi.cbSize = > System.Runtime.InteropServices.Marshal.SizeOf(typeof(SIPINFO)); > result = SipGetInfo(ref mySi); > mySi.rcSipRect.top = top; > mySi.rcSipRect.bottom = top + 80; > result = SipSetInfo(ref mySi); > } > > public void show() > { > SipShowIM(SIPStatus.SIPF_ON); > } > > public void hide() > { > SipShowIM(SIPStatus.SIPF_OFF); > } >
From: Manfred Denzer on 24 Jun 2008 04:26
Thank you very much for your answer! If works! I get the button with FindWindowW("MS_SIPBUTTON", null) and move it out of the window with MoveWindow. Greetings, Manfred |