Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Virtual Keyboard help plz

Virtual Keyboard help plz

Scheduled Pinned Locked Moved C#
help
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    arun_appu
    wrote on last edited by
    #1

    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

    N 1 Reply Last reply
    0
    • A arun_appu

      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

      N Offline
      N Offline
      Nick Parker
      wrote on last edited by
      #2

      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 calling SendMessage and passing it WM_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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups