打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
【新提醒】【U3D如何调用Win10的触摸键盘Touch KeyBoard非屏幕键盘(OSK.exe)】
[DllImport("user32")]  [/float][float=right][color=#4f4f4f][font="][size=16px]static extern IntPtr FindWindow(String sClassName, String sAppName); 
[DllImport("user32")] 
static extern bool PostMessage(IntPtr hWnd, uint Msg, int wParam, int lParam); 
/// <summary> 
/// 显示屏幕键盘 
/// </summary> 
public void ShowTouchKeyboard() 
    try 
    
        ExternalCall("C:\\Program Files\\Common Files\\Microsoft Shared\\ink\\tabtip.exe", null, false); 
    
    catch (Exception e) 
    
        UnityEngine.Debug.Log(e); 
    
/// <summary> 
/// 隐藏屏幕键盘 
/// </summary> 
public void HideTouchKeyboard() 
    try 
    
        uint WM_SYSCOMMAND = 274; 
        int SC_CLOSE = 61536; 
        IntPtr ptr = FindWindow("IPTip_Main_Window", null); 
        PostMessage(ptr, WM_SYSCOMMAND, SC_CLOSE, 0); 
    
    catch (Exception e) 
    
        UnityEngine.Debug.Log(e); 
    
private static Process ExternalCall(string filename, string arguments, bool hideWindow) 
    ProcessStartInfo startInfo = new ProcessStartInfo(); 
    startInfo.FileName = filename; 
    startInfo.Arguments = arguments; 
    //隐藏控制台
    if (hideWindow) 
    
        startInfo.RedirectStandardOutput = true
        startInfo.RedirectStandardError = true
        startInfo.UseShellExecute = false
        startInfo.CreateNoWindow = true
    
    Process process = new Process(); 
    process.StartInfo = startInfo; 
    process.Start(); 
    return process; 
}
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
Excel催化剂开源第47波-Excel与PowerBIDeskTop互通互联之第一篇
C#清除IE临时文件缓存cookies的方法
[WPF 学习] 5. 版本升级
在Winform中嵌入exe程序
总结C#启动外部程序的几种方法
在WinForm/C#中打开一个文件
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服