[DllImport("user32.dll")]
public static extern int FindWindow(string lpClassName,string lpWindowName);
[DllImport("user32.dll")]
public static extern int SendMessage(int hWnd,uint Msg,int wParam,int lParam);
public const int WM_SYSCOMMAND = 0x0112;
public const int SC_CLOSE = 0xF060;
private void cloSEOnscreenKeyboard()
{
// retrieve the handler of the window
int iHandle = FindWindow("IPTIP_Main_Window","");
if (iHandle > 0)
{
// close the window using API
SendMessage(iHandle,WM_SYSCOMMAND,SC_CLOSE,0);
}
}
private void Some_Event_Happened(object sender,EventArgs e)
{
// It's time to close the onscreen keyboard.
cloSEOnscreenKeyboard();
}
WPF 关闭平板电脑WIN10系统小键盘
最新推荐文章于 2023-06-01 17:25:22 发布