您当前的位置: 首页 > 

君子居易

暂无认证

  • 0浏览

    0关注

    210博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

WPF 关闭平板电脑WIN10系统小键盘

君子居易 发布时间:2021-12-27 11:27:32 ,浏览量:0

[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();
}

关注
打赏
1660814979
查看更多评论
立即登录/注册

微信扫码登录

0.0342s