I\'ve written a little program that navigates around the web for you (not particularly useful, but I\'m just using it to learn) using a webcontrol. I want to run it in the background, when it wouldn\'t have focus, and I\'d be doing other things. I\'ve found the sendmessage and findwindow APIs, and the findwindow seems to work. My problem seems to be both the FindWindowEx (which always returns 0) and the sendmessage(which has a type mismatch error I can\'t seem to get rid of) All this code should do is tab through the page.
\r\n
Code:
\r\n
Dim mWnd As Long\r\nmWnd = FindWindow(vbNullString, "Title")\r\nmWnd = FindWindowEx(mWnd, 0&, "Internet Explorer_Server", vbNullString)\r\ndo\r\n If WebBrowser1.Busy = False Then\r\n SendMessage mWnd, Val(vbKeyTab), 1, ByVal vbNullString\r\n DoEvents\r\n else\r\n DoEvents\r\n end if\r\nwhile bRunning=True
\r\n