Page 1 of 1

Re: Returning values from Main-thread

Posted: Thu Jul 05, 2018 7:44 am
by salvadordf
Hi,

You can try splitting your function in 2.
  • First half would have everything up until SendProcessMessage(PID_BROWSER, msg) is sent.
  • The second half would have everything else. This function should also have a parameter with the result calculated in the main process.
The main process would receive the message from the first JavaScript function and calculate a result.
Disable the GUI while it's calculated if you don't want user interference.
When the result is ready, the main process would only have to call the second JavaScript function with the result as the function parameter with a simple :

Code: Select all

TChromium.ExecuteJavaScript('SecondFunction(MainProcessResult)', 'about:blank');