Virtual Keyboard help plz
-
i have created an on screen Virtual keyboard what i did was i found the handle for the web browser form and directly used the send keys fn:- IntPtr webHandle = FindWindow("WindowsForms10.Window.8.app3", "Web Browser"); if (webHandle == IntPtr.Zero) { MessageBox.Show("Form is not running."); return; SetForegroundWindow(webHandle); SendKeys.Send("{a}"); } The problem is that no keys are going inside WebBrowser control. Please help me urgently. Thankyou Arun Appukuttan
-
i have created an on screen Virtual keyboard what i did was i found the handle for the web browser form and directly used the send keys fn:- IntPtr webHandle = FindWindow("WindowsForms10.Window.8.app3", "Web Browser"); if (webHandle == IntPtr.Zero) { MessageBox.Show("Form is not running."); return; SetForegroundWindow(webHandle); SendKeys.Send("{a}"); } The problem is that no keys are going inside WebBrowser control. Please help me urgently. Thankyou Arun Appukuttan
That isn't enough, you need to get the handle to the textbox you want to send text to. You might try
EnumChildWindows
where you pass it the handle to the browser control. You might also consider callingSendMessage
and passing itWM_SETTEXT
(0x000C) with the handle to the textbox instead of using SendKeys.[DllImport("user32.dll")]
static extern bool EnumChildWindows(IntPtr hwndParent, EnumWindowsProc lpEnumFunc, ref IntPtr lParam);- Nick Parker Microsoft MVP - Visual C#
My Blog | My Articles