Is it possible to sendkeys / Post Message directly to a HtmlElement rather than to a C# webbrowser
Posted
by Jakub
on Stack Overflow
See other posts from Stack Overflow
or by Jakub
Published on 2010-04-19T01:44:47Z
Indexed on
2010/04/19
1:53 UTC
Read the original article
Hit count: 675
I would like to send keys to a c# web browser control element directly, not just the window with the correct focus.
Right now I am able to send a key using PostMessage and documentHandle and focus like this
i.e. Pseudo Code HtmlElement el = getelement(); el.Focus(); IntPtr docptr = browser.Handle; PostMessage(docptr,WM_KEYDOWN,1,0); .... KEYCHAR, KEYUP..
I was wondering if anyone knows of any way to be able to do this in a background, so that the focus is not on the element. Basically is there a way to get a IntPtr to the HtmlElement itself, than use that instead in the PostMessage or SendKeys API rather than the browser handle/ptr.
© Stack Overflow or respective owner