gpt4 book ai didi

c# - 如何隐藏 Windows Mobile 6.5 中的小键盘弹出窗口? (C#)

转载 作者:行者123 更新时间:2023-11-30 20:08:13 24 4
gpt4 key购买 nike

我有一个应用程序,它本质上是一个通过一些对话框的向导。其中一个表单上只有一个按钮,可以调出常见的“拍照”对话框。

关闭该图片功能后,会出现小键盘图标(不方便地覆盖了我的一个向导按钮)。

我尝试通过调用将被覆盖的窗口设置为 fron:

nextButton.BringToFront();

但这没有任何效果。我需要以某种方式禁用小键盘图标,但不确定该怎么做。

注意 - 不是软键盘 - 而是用户点击的图像会弹出。

注意 - 此窗体上没有文本控件 - 只有 4 个按钮 - 一个启动 CameraCaptureDialog,其他几个控制用户转到“下一个”和“上一个”屏幕。

编辑

鉴于两个人都非常有信心他们的代码可以工作,并且查看在线引用资料我认为他们可能是正确的我想我会详细说明这个问题,因为这两个建议都不能解决问题。

键盘项似乎是我在“拍照”/CameraCaptureDialog 中选择菜单上的取消或确定按钮后遗留下来的。

在退出对话框时,我似乎还剩下中间/键盘菜单项,而且我似乎无能为力。

这是它在模拟器中的样子(也发生在模拟器上) enter image description here

注意 - 调用以下所有内容对隐藏按钮的键盘图标没有影响:

// nextButton is the Button on the control hidden by the keyboard icon thingy
nextButton.Focus();
nextButton.BringToFront();
nextButton.Invalidate();
nextButton.Refresh();
nextButton.Show();

最佳答案

我也在寻找隐藏小键盘图标(SIP 图标)的解决方案,我通过使用 FindWindowWMoveWindowSetWindowPos< 实现了这一点 coredll.dlluser32.dll

函数

声明我们感兴趣的函数:

    [DllImport("coredll.dll", EntryPoint = "FindWindowW", SetLastError = true)]
private static extern IntPtr FindWindow(string lpClassName, string lpWindowName);

[DllImport("coredll.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int x, int y, int cx, int cy, uint uFlags);

然后找到键盘图标的句柄并调用SetWindowPos来隐藏它:

IntPtr hWnd = FindWindow(Nothing, "MS_SIPBUTTON");
SetWindowPos(hWnd, 1, 0, 0, 0, 0, &H80);

有用的链接:

  1. P/Invoke - coredll.dll
  2. Disable keyboard icon in Windows Mobile using VB.net
  3. Manage SIP - 跳到这篇文章的底部并寻找评论用户名Mark

编辑

我不得不稍微修改一下才能编译。

    const int SWP_HIDE = 0x0080;
IntPtr hWnd = FindWindow(null, "MS_SIPBUTTON");
SetWindowPos(hWnd, IntPtr.Zero, 0, 0, 0, 0, SWP_HIDE);

关于c# - 如何隐藏 Windows Mobile 6.5 中的小键盘弹出窗口? (C#),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7290718/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com