无法在屏幕键盘上移动tabtip?

时间:2014-12-10 12:52:27

标签: c# wpf winapi process on-screen-keyboard

我的应用程序在触摸屏上输入了用户名和密码。 当屏幕键盘出现时,它将显示在用户名条目的顶部。 我希望它在屏幕上显得略低一些。我几乎可以肯定我正在使用正确的句柄,因为Spy ++告诉我它是相同的,当我使用具有相同句柄的close方法时它起作用。

这是我尝试过的代码。

[DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall, ExactSpelling = true, SetLastError = true)]
internal static extern void MoveWindow(IntPtr hwnd, int X, int Y, int nWidth, int nHeight, bool bRepaint);

[DllImport("user32.dll")]
public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);

public void OpenAndMoveTabTipWindow()
{         
    // Call on screen keyboard
    System.Diagnostics.Process.Start(@"C:\Program Files\Common Files\Microsoft Shared\ink\TabTip.exe");

    IntPtr id;           
    id = FindWindow("IPTIP_Main_Window", "");

    MoveWindow(id, 0, 0, 100, 100, true);
}

0 个答案:

没有答案
相关问题