Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

Returning values from Main-thread

Post Reply
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Returning values from Main-thread

Post 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');
Post Reply