I have a program that I created that loads a webpage in a WebBrowser control. The web page has several boxes of information that must be filled in, when the Enter key is pressed, the page dynamically builds itself. This all works well, but the problem that I run into is that when the Enter key is pressed I need to call an OCR API function that will output my page to a text file (there are .jpg images on the page that contain writing that I need to capture, hence why I am using OCR).
So far, I have been playing around with the using the following:
This works to intercept the Enter keypress, however, I am assuming that beginCapture() is being called before the page is being updated by the Enter press. Will the web page update only after catchEnter() has ended? I do not see that the WebBrowser control supports just the KeyPress event, so I am a bit stumped on how to handle this process. I did explore using the WH_KEYBOARD Hook but have not been successful with it.
Does anyone have any ideas or suggestions? I would be extremely grateful for any help or direction that you can provide. Thanks in advance!
So far, I have been playing around with the using the following:
VB.NET:
Private Sub catchEnter(ByVal send As Object, ByVal e As System.Windows.Forms.PreviewKeyDownEventArgs) _
Handles wbMain.PreviewKeyDown
If e.KeyValue = Keys.Enter Then
Call beginCapture()
End If
End Sub
Does anyone have any ideas or suggestions? I would be extremely grateful for any help or direction that you can provide. Thanks in advance!