I am not using the webBrowser element but the Hooks to handle the web browser window. I have no control over the HTML content of the web browser Document, neither can write to it nor read from it. I only have the process id of the web browser and I am using it to handle the window, I can send keystrokes to it, I can send mouse clicks to it and I can send all other kind of input to it but I can not tinkle with the source codes of the page loaded into it.
to navigate, I have only one choice that is to simulate keyboard shortcuts for the window.
Now I want to click on a button, say the "Reply" button just beneath this post, How do I do that ? Is there any way ? any library, any concept or anything else ?
I am googling for a solution from last 15 days and all I found is a couple of users with same problem, a tons of unanswered post regarding similar question and no solution for my problem :uncomfortableness:
Since I can send keystrokes to the web browser window I thought of using "JavaScript Injection" to produce some kind of clicks on an element on web page, like:
sendkeys.sendwait("^{L}") 'Send Ctrl+L to focus the address bar
sendkeys.sendwait("getElementById('SomeDivId').click()") 'Write Javascript to the address bar
sendkeys.sendwait("{ENTER}") 'Send 'ENTER' key to process the JavaScript
but definitely that is not a universal solution for a ton of reasons.
Any other possible concept you can think of ?
Please help me, I am totally lost