SendMessage to Internet Explorer

J

Jay Drozd

I'm trying to write my own small 'wedge' application that will allow data
from a serial I/O connection to be placed into whichever textbox has the
focus at a particular time. I have seen them done, but I am trying to write
my own. I can call the SendMessage API to any other textbox and it works
fine, but when the textbox is within an IE browser(on the page) it doesn't
seem to work.

Am I going about this the write way? Anybody have any insight on creating a
small application like this?
Currently I am:
Getting foreground window from GetForegroundWindow
Getting the thread ID of that process and the current process from
GetWindowThreadProcessId and GetCurrentThreadId
Attaching the Thread Input via AttachThreadInput
Using GetFocus to get the hwnd of the window which currently has focus.

Please somebody shed a little bit of light on this subject.

thanks
-Jay
 
S

Sankar Nemani

When I tried to do a find window using VS tools->spy, I found out that the
text boxes inside the IE pages apparently are not implemented as windows. I
guess for efficiency reasons. So if the window is an IE window you may have
to use some kind of java script or IE object model to find the textbox that
has focus inside the html page. Otherwise you may need to use an activex
control or an embedded .NET control that has a textbox and obviously u can
find it using ur code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top