|
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
namespace BeeMobile
{
public class SIP
{
[DllImport("coredll.dll", SetLastError = true)]
private static extern IntPtr FindWindow(string caption, string className);
[DllImport("coredll.dll", SetLastError = true)]
private static extern bool ShowWindow(IntPtr hwnd, int state);
private const int SW_HIDE = 0;
private const int SW_SHOW = 1;
[DllImport("coredll.dll")]
private static extern IntPtr GetWindow(IntPtr hWnd, uint uCmd);
/// <summary>
/// Hides the SIP (Software Input Panel) button.
/// </summary>
static public void HideSIP()
{
IntPtr hSipWindow = FindWindow("MS_SIPBUTTON", "MS_SIPBUTTON");
if (hSipWindow != IntPtr.Zero)
{
IntPtr hSipButton = GetWindow(hSipWindow, 5);
if (hSipButton != IntPtr.Zero)
{
bool res = ShowWindow(hSipButton, SW_HIDE);
}
}
}
/// <summary>
/// Shows the SIP (Software Input Panel) button.
/// </summary>
static public void ShowSIP()
{
IntPtr hSipWindow = FindWindow("MS_SIPBUTTON", "MS_SIPBUTTON");
if (hSipWindow != IntPtr.Zero)
{
IntPtr hSipButton = GetWindow(hSipWindow, 5);
if (hSipButton != IntPtr.Zero)
{
bool res = ShowWindow(hSipButton, SW_SHOW);
}
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I work for Bee Mobile.
Web site: http://beemobile4.net
Facebook site: http://facebook.com/BeeMobile
YouTube Channel: http://youtube.com/beemobile4dotnet