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.