0

Platform= Windows 7,C#

Environment=Visual Studio 2013

I want to open Windows builtin OnScreenKeyBoard on the required location of screen. Using following code i can open Notepad at desired location but failed to open OnScreenKeyBorad "osk.exe"at my required location.

class Program
{
    static void Main(string[] args)
    {
        var prc = Process.Start("osk.exe");
        prc.WaitForInputIdle();
        bool ok = MoveWindow(prc.MainWindowHandle, 0, 0, 300, 200, false);
        if (!ok) throw new System.ComponentModel.Win32Exception();
    }
    [DllImport("user32.dll", SetLastError = true)]
    private static extern bool MoveWindow(IntPtr hWnd, int x, int y, int width, int height, bool repaint);
}

So can anyone help me, so that i can open OnScreenKeyBorad at my desired location of laptop screen. I also tried SetWindowPos but all in vain.

Qudsia
  • 5
  • 4

0 Answers0